From b406eadfe3ef0e70ec7f68cca3d45628bf1c19f8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 16 Jul 2004 00:10:54 +0000 Subject: For 64-bit platform support, we now use the clEnumValEnd macro to terminate cl::values lists git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14869 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CommandLine.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'docs/CommandLine.html') diff --git a/docs/CommandLine.html b/docs/CommandLine.html index 855c1e9b31..7353375019 100644 --- a/docs/CommandLine.html +++ b/docs/CommandLine.html @@ -493,7 +493,7 @@ enum OptLevel { clEnumVal(O1, "Enable trivial optimizations"), clEnumVal(O2, "Enable default optimizations"), clEnumVal(O3, "Enable expensive optimizations"), - 0)); + clEnumValEnd)); ... if (OptimizationLevel >= O2) doPartialRedundancyElimination(...); @@ -503,7 +503,8 @@ enum OptLevel {

This declaration defines a variable "OptimizationLevel" of the "OptLevel" enum type. This variable can be assigned any of the values that are listed in the declaration (Note that the declaration list must be -terminated with the "0" argument!). The CommandLine library enforces +terminated with the "clEnumValEnd" argument!). The CommandLine +library enforces that the user can only specify one of the options, and it ensure that only valid enum values can be specified. The "clEnumVal" macros ensure that the command line arguments matched the enum values. With this option added, our @@ -540,7 +541,7 @@ enum OptLevel { clEnumVal(O1 , "Enable trivial optimizations"), clEnumVal(O2 , "Enable default optimizations"), clEnumVal(O3 , "Enable expensive optimizations"), - 0)); + clEnumValEnd)); ... if (OptimizationLevel == Debug) outputDebugInfo(...); @@ -581,7 +582,7 @@ enum DebugLev { clEnumValN(nodebuginfo, "none", "disable debug information"), clEnumVal(quick, "enable quick debug information"), clEnumVal(detailed, "enable detailed debug information"), - 0)); + clEnumValEnd));

This definition defines an enumerated command line variable of type "enum @@ -648,7 +649,7 @@ enum Opts { clEnumVal(constprop , "Constant Propagation"), clEnumValN(inlining, "inline", "Procedure Integration"), clEnumVal(strip , "Strip Symbols"), - 0)); + clEnumValEnd));

This defines a variable that is conceptually of the type @@ -998,7 +999,8 @@ for.

  • The cl::values attribute specifies the string-to-value mapping to be used by the generic parser. It takes a -null terminated list of (option, value, description) triplets that +clEnumValEnd terminated list of (option, value, description) triplets +that specify the option name, the value mapped to, and the description shown in the --help for the tool. Because the generic parser is used most frequently with enum values, two macros are often useful: -- cgit v1.2.3-18-g5258