[llvm-commits] CVS: llvm/include/llvm/Support/Annotation.h CommandLine.h DOTGraphTraits.h

Chris Lattner lattner at cs.uiuc.edu
Wed Oct 27 09:15:04 PDT 2004



Changes in directory llvm/include/llvm/Support:

Annotation.h updated: 1.16 -> 1.17
CommandLine.h updated: 1.36 -> 1.37
DOTGraphTraits.h updated: 1.10 -> 1.11
---
Log message:

Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!


---
Diffs of the changes:  (+21 -17)

Index: llvm/include/llvm/Support/Annotation.h
diff -u llvm/include/llvm/Support/Annotation.h:1.16 llvm/include/llvm/Support/Annotation.h:1.17
--- llvm/include/llvm/Support/Annotation.h:1.16	Wed Sep  1 17:55:34 2004
+++ llvm/include/llvm/Support/Annotation.h	Wed Oct 27 11:14:51 2004
@@ -30,7 +30,7 @@
 class AnnotationID;
 class Annotation;
 class Annotable;
-class AnnotationManager;
+struct AnnotationManager;
 
 //===----------------------------------------------------------------------===//
 //
@@ -39,7 +39,7 @@
 // freely around and passed byvalue with little or no overhead.
 //
 class AnnotationID {
-  friend class AnnotationManager;
+  friend struct AnnotationManager;
   unsigned ID;
 
   AnnotationID();                             // Default ctor is disabled


Index: llvm/include/llvm/Support/CommandLine.h
diff -u llvm/include/llvm/Support/CommandLine.h:1.36 llvm/include/llvm/Support/CommandLine.h:1.37
--- llvm/include/llvm/Support/CommandLine.h:1.36	Wed Sep  1 17:55:35 2004
+++ llvm/include/llvm/Support/CommandLine.h	Wed Oct 27 11:14:51 2004
@@ -513,8 +513,8 @@
 // parser<bool>
 //
 template<>
-struct parser<bool> : public basic_parser<bool> {
-
+class parser<bool> : public basic_parser<bool> {
+public:
   // parse - Return true on error.
   bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
 
@@ -531,8 +531,8 @@
 // parser<int>
 //
 template<>
-struct parser<int> : public basic_parser<int> {
-  
+class parser<int> : public basic_parser<int> {
+public:
   // parse - Return true on error.
   bool parse(Option &O, const char *ArgName, const std::string &Arg, int &Val);
 
@@ -545,8 +545,8 @@
 // parser<unsigned>
 //
 template<>
-struct parser<unsigned> : public basic_parser<unsigned> {
-  
+class parser<unsigned> : public basic_parser<unsigned> {
+public:
   // parse - Return true on error.
   bool parse(Option &O, const char *AN, const std::string &Arg, unsigned &Val);
 
@@ -559,7 +559,8 @@
 // parser<double>
 //
 template<>
-struct parser<double> : public basic_parser<double> {
+class parser<double> : public basic_parser<double> {
+public:
   // parse - Return true on error.
   bool parse(Option &O, const char *AN, const std::string &Arg, double &Val);
 
@@ -572,7 +573,8 @@
 // parser<float>
 //
 template<>
-struct parser<float> : public basic_parser<float> {
+class parser<float> : public basic_parser<float> {
+public:
   // parse - Return true on error.
   bool parse(Option &O, const char *AN, const std::string &Arg, float &Val);
 
@@ -585,7 +587,8 @@
 // parser<std::string>
 //
 template<>
-struct parser<std::string> : public basic_parser<std::string> {
+class parser<std::string> : public basic_parser<std::string> {
+public:
   // parse - Return true on error.
   bool parse(Option &O, const char *AN, const std::string &Arg, 
              std::string &Value) {
@@ -687,8 +690,8 @@
 // object in all cases that it is used.
 //
 template<class DataType>
-struct opt_storage<DataType,false,true> : public DataType {
-
+class opt_storage<DataType,false,true> : public DataType {
+public:
   template<class T>
   void setValue(const T &V) { DataType::operator=(V); }
 
@@ -701,7 +704,8 @@
 // to get at the value.
 //
 template<class DataType>
-struct opt_storage<DataType, false, false> {
+class opt_storage<DataType, false, false> {
+public:
   DataType Value;
 
   // Make sure we initialize the value with the default constructor for the
@@ -864,8 +868,8 @@
 // object in all cases that it is used.
 //
 template<class DataType>
-struct list_storage<DataType, bool> : public std::vector<DataType> {
-
+class list_storage<DataType, bool> : public std::vector<DataType> {
+public:
   template<class T>
   void addValue(const T &V) { push_back(V); }
 };


Index: llvm/include/llvm/Support/DOTGraphTraits.h
diff -u llvm/include/llvm/Support/DOTGraphTraits.h:1.10 llvm/include/llvm/Support/DOTGraphTraits.h:1.11
--- llvm/include/llvm/Support/DOTGraphTraits.h:1.10	Wed Sep  1 17:55:35 2004
+++ llvm/include/llvm/Support/DOTGraphTraits.h	Wed Oct 27 11:14:51 2004
@@ -95,7 +95,7 @@
 /// from DefaultDOTGraphTraits if you don't need to override everything.
 ///
 template <typename Ty>
-class DOTGraphTraits : public DefaultDOTGraphTraits {};
+struct DOTGraphTraits : public DefaultDOTGraphTraits {};
 
 } // End llvm namespace
 






More information about the llvm-commits mailing list