mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-13 14:36:18 +03:00
Add LDC-specific support for __traits(getTargetInfo)
This commit is contained in:
parent
ee8f1ffa00
commit
0bd9a10234
5 changed files with 75 additions and 16 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue