[llvm-commits] [llvm] r51737 - in /llvm/trunk: tools/llvmc2/Tools.td utils/TableGen/LLVMCConfigurationEmitter.cpp
Mikhail Glushenkov
foldr at codedgers.com
Thu May 29 23:15:20 PDT 2008
Author: foldr
Date: Fri May 30 01:15:20 2008
New Revision: 51737
URL: http://llvm.org/viewvc/llvm-project?rev=51737&view=rev
Log:
Do not generate empty 'if's for the output_suffix property.
Modified:
llvm/trunk/tools/llvmc2/Tools.td
llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
Modified: llvm/trunk/tools/llvmc2/Tools.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/Tools.td?rev=51737&r1=51736&r2=51737&view=diff
==============================================================================
--- llvm/trunk/tools/llvmc2/Tools.td (original)
+++ llvm/trunk/tools/llvmc2/Tools.td Fri May 30 01:15:20 2008
@@ -27,7 +27,7 @@
(output_suffix "bc"),
(cmd_line (case
(switch_on "E"),
- "llvm-g++ -E -x c $INFILE -o $OUTFILE -emit-llvm",
+ "llvm-g++ -E -x c $INFILE -o $OUTFILE",
(default),
"llvm-g++ -c -x c $INFILE -o $OUTFILE -emit-llvm")),
(switch_option "E", (stop_compilation),(output_suffix "i"),
@@ -41,7 +41,7 @@
(output_suffix "bc"),
(cmd_line (case
(switch_on "E"),
- "llvm-g++ -E -x c++ $INFILE -o $OUTFILE -emit-llvm",
+ "llvm-g++ -E -x c++ $INFILE -o $OUTFILE",
(default),
"llvm-g++ -c -x c++ $INFILE -o $OUTFILE -emit-llvm")),
(switch_option "E", (stop_compilation), (output_suffix "i")),
Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=51737&r1=51736&r2=51737&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Fri May 30 01:15:20 2008
@@ -790,12 +790,20 @@
}
}
-// A helper function used by EmitOptionPropertyHandlingCode() that
-// tells us whether we should emit any code at all.
+// ToolOptionHasInterestingProperties - A helper function used by
+// EmitOptionPropertyHandlingCode() that tells us whether we should
+// emit any property handling code at all.
bool ToolOptionHasInterestingProperties(const ToolOptionDescription& D) {
- if (!D.isForward() && !D.isUnpackValues() && D.Props.empty())
- return false;
- return true;
+ bool ret = false;
+ for (OptionPropertyList::const_iterator B = D.Props.begin(),
+ E = D.Props.end(); B != E; ++B) {
+ const OptionProperty& OptProp = *B;
+ if (OptProp.first == OptionPropertyType::AppendCmd)
+ ret = true;
+ }
+ if (D.isForward() || D.isUnpackValues())
+ ret = true;
+ return ret;
}
/// EmitOptionPropertyHandlingCode - Helper function used by
More information about the llvm-commits
mailing list