mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 03:32:10 +00:00
minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3418579046
commit
49b301c40a
@ -105,9 +105,10 @@ void Option::addArgument() {
|
|||||||
|
|
||||||
/// GetOptionInfo - Scan the list of registered options, turning them into data
|
/// GetOptionInfo - Scan the list of registered options, turning them into data
|
||||||
/// structures that are easier to handle.
|
/// structures that are easier to handle.
|
||||||
static void GetOptionInfo(std::vector<Option*> &PositionalOpts,
|
static void GetOptionInfo(SmallVectorImpl<Option*> &PositionalOpts,
|
||||||
std::vector<Option*> &SinkOpts,
|
SmallVectorImpl<Option*> &SinkOpts,
|
||||||
StringMap<Option*> &OptionsMap) {
|
StringMap<Option*> &OptionsMap) {
|
||||||
|
// FIXME: SmallVectorize.
|
||||||
std::vector<const char*> OptionNames;
|
std::vector<const char*> OptionNames;
|
||||||
Option *CAOpt = 0; // The ConsumeAfter option if it exists.
|
Option *CAOpt = 0; // The ConsumeAfter option if it exists.
|
||||||
for (Option *O = RegisteredOptionList; O; O = O->getNextRegisteredOption()) {
|
for (Option *O = RegisteredOptionList; O; O = O->getNextRegisteredOption()) {
|
||||||
@ -453,8 +454,8 @@ static void ExpandResponseFiles(unsigned argc, char** argv,
|
|||||||
void cl::ParseCommandLineOptions(int argc, char **argv,
|
void cl::ParseCommandLineOptions(int argc, char **argv,
|
||||||
const char *Overview, bool ReadResponseFiles) {
|
const char *Overview, bool ReadResponseFiles) {
|
||||||
// Process all registered options.
|
// Process all registered options.
|
||||||
std::vector<Option*> PositionalOpts;
|
SmallVector<Option*, 4> PositionalOpts;
|
||||||
std::vector<Option*> SinkOpts;
|
SmallVector<Option*, 4> SinkOpts;
|
||||||
StringMap<Option*> Opts;
|
StringMap<Option*> Opts;
|
||||||
GetOptionInfo(PositionalOpts, SinkOpts, Opts);
|
GetOptionInfo(PositionalOpts, SinkOpts, Opts);
|
||||||
|
|
||||||
@ -617,7 +618,7 @@ void cl::ParseCommandLineOptions(int argc, char **argv,
|
|||||||
<< argv[i] << "'. Try: '" << argv[0] << " --help'\n";
|
<< argv[i] << "'. Try: '" << argv[0] << " --help'\n";
|
||||||
ErrorParsing = true;
|
ErrorParsing = true;
|
||||||
} else {
|
} else {
|
||||||
for (std::vector<Option*>::iterator I = SinkOpts.begin(),
|
for (SmallVectorImpl<Option*>::iterator I = SinkOpts.begin(),
|
||||||
E = SinkOpts.end(); I != E ; ++I)
|
E = SinkOpts.end(); I != E ; ++I)
|
||||||
(*I)->addOccurrence(i, "", argv[i]);
|
(*I)->addOccurrence(i, "", argv[i]);
|
||||||
}
|
}
|
||||||
@ -1031,8 +1032,8 @@ public:
|
|||||||
if (Value == false) return;
|
if (Value == false) return;
|
||||||
|
|
||||||
// Get all the options.
|
// Get all the options.
|
||||||
std::vector<Option*> PositionalOpts;
|
SmallVector<Option*, 4> PositionalOpts;
|
||||||
std::vector<Option*> SinkOpts;
|
SmallVector<Option*, 4> SinkOpts;
|
||||||
StringMap<Option*> OptMap;
|
StringMap<Option*> OptMap;
|
||||||
GetOptionInfo(PositionalOpts, SinkOpts, OptMap);
|
GetOptionInfo(PositionalOpts, SinkOpts, OptMap);
|
||||||
|
|
||||||
@ -1129,25 +1130,26 @@ namespace {
|
|||||||
class VersionPrinter {
|
class VersionPrinter {
|
||||||
public:
|
public:
|
||||||
void print() {
|
void print() {
|
||||||
outs() << "Low Level Virtual Machine (http://llvm.org/):\n"
|
raw_ostream &OS = outs();
|
||||||
<< " " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
|
OS << "Low Level Virtual Machine (http://llvm.org/):\n"
|
||||||
|
<< " " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
|
||||||
#ifdef LLVM_VERSION_INFO
|
#ifdef LLVM_VERSION_INFO
|
||||||
outs() << LLVM_VERSION_INFO;
|
OS << LLVM_VERSION_INFO;
|
||||||
#endif
|
#endif
|
||||||
outs() << "\n ";
|
OS << "\n ";
|
||||||
#ifndef __OPTIMIZE__
|
#ifndef __OPTIMIZE__
|
||||||
outs() << "DEBUG build";
|
OS << "DEBUG build";
|
||||||
#else
|
#else
|
||||||
outs() << "Optimized build";
|
OS << "Optimized build";
|
||||||
#endif
|
#endif
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
outs() << " with assertions";
|
OS << " with assertions";
|
||||||
#endif
|
#endif
|
||||||
outs() << ".\n"
|
OS << ".\n"
|
||||||
<< " Built " << __DATE__ << " (" << __TIME__ << ").\n"
|
<< " Built " << __DATE__ << " (" << __TIME__ << ").\n"
|
||||||
<< " Host: " << sys::getHostTriple() << '\n'
|
<< " Host: " << sys::getHostTriple() << '\n'
|
||||||
<< "\n"
|
<< '\n'
|
||||||
<< " Registered Targets:\n";
|
<< " Registered Targets:\n";
|
||||||
|
|
||||||
std::vector<std::pair<const char *, const Target*> > Targets;
|
std::vector<std::pair<const char *, const Target*> > Targets;
|
||||||
size_t Width = 0;
|
size_t Width = 0;
|
||||||
@ -1161,12 +1163,12 @@ public:
|
|||||||
TargetArraySortFn);
|
TargetArraySortFn);
|
||||||
|
|
||||||
for (unsigned i = 0, e = Targets.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Targets.size(); i != e; ++i) {
|
||||||
outs() << " " << Targets[i].first;
|
OS << " " << Targets[i].first;
|
||||||
outs().indent(Width - strlen(Targets[i].first)) << " - "
|
OS.indent(Width - strlen(Targets[i].first)) << " - "
|
||||||
<< Targets[i].second->getShortDescription() << '\n';
|
<< Targets[i].second->getShortDescription() << '\n';
|
||||||
}
|
}
|
||||||
if (Targets.empty())
|
if (Targets.empty())
|
||||||
outs() << " (none)\n";
|
OS << " (none)\n";
|
||||||
}
|
}
|
||||||
void operator=(bool OptionWasSpecified) {
|
void operator=(bool OptionWasSpecified) {
|
||||||
if (!OptionWasSpecified) return;
|
if (!OptionWasSpecified) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user