mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
avoid a ctor/dtor issue with the ProgramName global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30925 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f3799d6317
commit
efa3da5593
@ -57,8 +57,9 @@ void parser<std::string>::anchor() {}
|
|||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// Globals for name and overview of program
|
// Globals for name and overview of program. Program name is not a string to
|
||||||
static std::string ProgramName = "<premain>";
|
// avoid static ctor/dtor issues.
|
||||||
|
static char ProgramName[80] = "<premain>";
|
||||||
static const char *ProgramOverview = 0;
|
static const char *ProgramOverview = 0;
|
||||||
|
|
||||||
// This collects additional help to be printed.
|
// This collects additional help to be printed.
|
||||||
@ -303,7 +304,12 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
|
|||||||
"No options specified, or ParseCommandLineOptions called more"
|
"No options specified, or ParseCommandLineOptions called more"
|
||||||
" than once!");
|
" than once!");
|
||||||
sys::Path progname(argv[0]);
|
sys::Path progname(argv[0]);
|
||||||
ProgramName = sys::Path(argv[0]).getLast();
|
|
||||||
|
// Copy the program name into ProgName, making sure not to overflow it.
|
||||||
|
std::string ProgName = sys::Path(argv[0]).getLast();
|
||||||
|
if (ProgName.size() > 79) ProgName.resize(79);
|
||||||
|
strcpy(ProgramName, ProgName.c_str());
|
||||||
|
|
||||||
ProgramOverview = Overview;
|
ProgramOverview = Overview;
|
||||||
bool ErrorParsing = false;
|
bool ErrorParsing = false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user