Provide better support for pointer-valued command line arguments
authorChris Lattner <sabre@nondot.org>
Sun, 11 Jul 2004 03:18:30 +0000 (03:18 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 11 Jul 2004 03:18:30 +0000 (03:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14746 91177308-0d34-0410-b5e6-96231b3b80d8

include/Support/CommandLine.h
include/llvm/Support/CommandLine.h

index 0d1d14813cd4cc7eaa1d272addbf1f46b94ea19f..b7bd62a38074886cf1c695ea359ffe96fe4275e1 100644 (file)
@@ -711,6 +711,9 @@ struct opt_storage<DataType, false, false> {
   void setValue(const T &V) { Value = V; }
   DataType &getValue() { return Value; }
   DataType getValue() const { return Value; }
+
+  // If the datatype is a pointer, support -> on it.
+  DataType operator->() const { return Value; }
 };
 
 
index 0d1d14813cd4cc7eaa1d272addbf1f46b94ea19f..b7bd62a38074886cf1c695ea359ffe96fe4275e1 100644 (file)
@@ -711,6 +711,9 @@ struct opt_storage<DataType, false, false> {
   void setValue(const T &V) { Value = V; }
   DataType &getValue() { return Value; }
   DataType getValue() const { return Value; }
+
+  // If the datatype is a pointer, support -> on it.
+  DataType operator->() const { return Value; }
 };