mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-12 05:47:11 +03:00
Misc. merge fixes (C++)
This commit is contained in:
parent
48809250d8
commit
a053480010
17 changed files with 49 additions and 75 deletions
|
@ -139,8 +139,9 @@ void printVersion(llvm::raw_ostream &OS) {
|
|||
}
|
||||
|
||||
// Helper function to handle -d-debug=* and -d-version=*
|
||||
void processVersions(std::vector<std::string> &list, const char *type,
|
||||
unsigned &globalLevel, Strings *&globalIDs) {
|
||||
template <typename Condition>
|
||||
void processVersions(const std::vector<std::string> &list, const char *type,
|
||||
unsigned &globalLevel) {
|
||||
for (const auto &i : list) {
|
||||
const char *value = i.c_str();
|
||||
if (isdigit(value[0])) {
|
||||
|
@ -155,12 +156,9 @@ void processVersions(std::vector<std::string> &list, const char *type,
|
|||
} else {
|
||||
char *cstr = mem.xstrdup(value);
|
||||
if (Identifier::isValidIdentifier(cstr)) {
|
||||
if (!globalIDs)
|
||||
globalIDs = createStrings();
|
||||
globalIDs->push(cstr);
|
||||
continue;
|
||||
Condition::addGlobalIdent(cstr);
|
||||
} else {
|
||||
error(Loc(), "Invalid %s identifier or level: '%s'", type, i.c_str());
|
||||
error(Loc(), "Invalid %s identifier or level: '%s'", type, cstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +322,7 @@ void parseCommandLine(Strings &sourceFiles) {
|
|||
// - path to compiler binary
|
||||
// - version number
|
||||
// - used config file
|
||||
if (global.params.verbose) {
|
||||
if (global.params.v.verbose) {
|
||||
message("binary %s", exe_path::getExePath().c_str());
|
||||
message("version %s (DMD %s, LLVM %s)", ldc::ldc_version,
|
||||
ldc::dmd_version, ldc::llvm_version);
|
||||
|
@ -416,10 +414,9 @@ void parseCommandLine(Strings &sourceFiles) {
|
|||
|
||||
opts::initializeSanitizerOptionsFromCmdline();
|
||||
|
||||
processVersions(debugArgs, "debug", global.params.debuglevel,
|
||||
global.params.debugids);
|
||||
processVersions(versions, "version", global.params.versionlevel,
|
||||
global.params.versionids);
|
||||
processVersions<DebugCondition>(debugArgs, "debug", global.params.debuglevel);
|
||||
processVersions<VersionCondition>(versions, "version",
|
||||
global.params.versionlevel);
|
||||
|
||||
for (const auto &id : transitions)
|
||||
parseTransitionOption(global.params, id.c_str());
|
||||
|
@ -449,11 +446,6 @@ void parseCommandLine(Strings &sourceFiles) {
|
|||
global.params.allInst = true;
|
||||
}
|
||||
|
||||
// -wo implies at least -wi (print the warnings)
|
||||
if (global.params.obsolete && global.params.warnings == DIAGNOSTICoff) {
|
||||
global.params.warnings = DIAGNOSTICinform;
|
||||
}
|
||||
|
||||
global.params.output_o =
|
||||
(opts::output_o == cl::BOU_UNSET &&
|
||||
!(opts::output_bc || opts::output_ll || opts::output_s ||
|
||||
|
@ -1136,8 +1128,6 @@ int cppmain() {
|
|||
|
||||
global.compileEnv.previewIn = global.params.previewIn;
|
||||
global.compileEnv.ddocOutput = global.params.ddoc.doOutput;
|
||||
global.compileEnv.shortenedMethods = global.params.shortenedMethods;
|
||||
global.compileEnv.obsolete = global.params.obsolete;
|
||||
|
||||
if (opts::fTimeTrace) {
|
||||
initializeTimeTrace(opts::fTimeTraceGranularity, 0, opts::allArguments[0]);
|
||||
|
@ -1268,7 +1258,7 @@ void codegenModules(Modules &modules) {
|
|||
if (m->filetype == FileType::dhdr)
|
||||
continue;
|
||||
|
||||
if (global.params.verbose)
|
||||
if (global.params.v.verbose)
|
||||
message("code %s", m->toChars());
|
||||
|
||||
const auto atCompute = hasComputeAttr(m);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue