[cfe-commits] r76200 - /cfe/trunk/tools/driver/driver.cpp

Daniel Dunbar daniel at zuster.org
Fri Jul 17 11:10:27 PDT 2009


Author: ddunbar
Date: Fri Jul 17 13:10:27 2009
New Revision: 76200

URL: http://llvm.org/viewvc/llvm-project?rev=76200&view=rev
Log:
Fix indentation / trailing white space.

Modified:
    cfe/trunk/tools/driver/driver.cpp

Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=76200&r1=76199&r2=76200&view=diff

==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Jul 17 13:10:27 2009
@@ -34,7 +34,7 @@
   llvm::raw_ostream &OS;
 
 public:
-  DriverDiagnosticPrinter(const std::string _ProgName, 
+  DriverDiagnosticPrinter(const std::string _ProgName,
                           llvm::raw_ostream &_OS)
     : ProgName(_ProgName),
       OS(_OS) {}
@@ -54,7 +54,7 @@
   case Diagnostic::Error:   OS << "error: "; break;
   case Diagnostic::Fatal:   OS << "fatal error: "; break;
   }
-  
+
   llvm::SmallString<100> OutStr;
   Info.FormatDiagnostic(OutStr);
   OS.write(OutStr.begin(), OutStr.size());
@@ -68,7 +68,7 @@
   return llvm::sys::Path::GetMainExecutable(Argv0, P);
 }
 
-static const char *SaveStringInSet(std::set<std::string> &SavedStrings, 
+static const char *SaveStringInSet(std::set<std::string> &SavedStrings,
                                    const std::string &S) {
   return SavedStrings.insert(S).first->c_str();
 }
@@ -101,54 +101,54 @@
 /// \param Edit - The override command to perform.
 /// \param SavedStrings - Set to use for storing string representations.
 void ApplyOneQAOverride(llvm::raw_ostream &OS,
-                        std::vector<const char*> &Args, 
+                        std::vector<const char*> &Args,
                         const std::string &Edit,
                         std::set<std::string> &SavedStrings) {
   // This does not need to be efficient.
 
-   if (Edit[0] == '^') {
-     const char *Str = 
-       SaveStringInSet(SavedStrings, Edit.substr(1, std::string::npos));
-     OS << "### Adding argument " << Str << " at beginning\n";
-     Args.insert(Args.begin() + 1, Str);
-   } else if (Edit[0] == '+') {
-     const char *Str = 
-       SaveStringInSet(SavedStrings, Edit.substr(1, std::string::npos));
-     OS << "### Adding argument " << Str << " at end\n";
-     Args.push_back(Str);
-   } else if (Edit[0] == 'x' || Edit[0] == 'X') {
-     std::string Option = Edit.substr(1, std::string::npos);
-     for (unsigned i = 1; i < Args.size();) {
-       if (Option == Args[i]) {
-         OS << "### Deleting argument " << Args[i] << '\n';
-         Args.erase(Args.begin() + i);
-         if (Edit[0] == 'X') {
-           if (i < Args.size()) {
-             OS << "### Deleting argument " << Args[i] << '\n';
-             Args.erase(Args.begin() + i);
-           } else
-             OS << "### Invalid X edit, end of command line!\n";
-         }
-       } else
-         ++i;
-     }
-   } else if (Edit[0] == 'O') {
-     for (unsigned i = 1; i < Args.size();) {
-       const char *A = Args[i];
-       if (A[0] == '-' && A[1] == 'O' && 
-           (A[2] == '\0' || 
-            (A[3] == '\0' && (A[2] == 's' || A[2] == 'z' ||
-                              ('0' <= A[2] && A[2] <= '9'))))) {
-         OS << "### Deleting argument " << Args[i] << '\n';
-         Args.erase(Args.begin() + i);
-       } else
-         ++i;
-     }     
-     OS << "### Adding argument " << Edit << " at end\n";
-     Args.push_back(SaveStringInSet(SavedStrings, '-' + Edit));
-   } else {
-     OS << "### Unrecognized edit: " << Edit << "\n";
-   }
+  if (Edit[0] == '^') {
+    const char *Str =
+      SaveStringInSet(SavedStrings, Edit.substr(1, std::string::npos));
+    OS << "### Adding argument " << Str << " at beginning\n";
+    Args.insert(Args.begin() + 1, Str);
+  } else if (Edit[0] == '+') {
+    const char *Str =
+      SaveStringInSet(SavedStrings, Edit.substr(1, std::string::npos));
+    OS << "### Adding argument " << Str << " at end\n";
+    Args.push_back(Str);
+  } else if (Edit[0] == 'x' || Edit[0] == 'X') {
+    std::string Option = Edit.substr(1, std::string::npos);
+    for (unsigned i = 1; i < Args.size();) {
+      if (Option == Args[i]) {
+        OS << "### Deleting argument " << Args[i] << '\n';
+        Args.erase(Args.begin() + i);
+        if (Edit[0] == 'X') {
+          if (i < Args.size()) {
+            OS << "### Deleting argument " << Args[i] << '\n';
+            Args.erase(Args.begin() + i);
+          } else
+            OS << "### Invalid X edit, end of command line!\n";
+        }
+      } else
+        ++i;
+    }
+  } else if (Edit[0] == 'O') {
+    for (unsigned i = 1; i < Args.size();) {
+      const char *A = Args[i];
+      if (A[0] == '-' && A[1] == 'O' &&
+          (A[2] == '\0' ||
+           (A[3] == '\0' && (A[2] == 's' || A[2] == 'z' ||
+                             ('0' <= A[2] && A[2] <= '9'))))) {
+        OS << "### Deleting argument " << Args[i] << '\n';
+        Args.erase(Args.begin() + i);
+      } else
+        ++i;
+    }
+    OS << "### Adding argument " << Edit << " at end\n";
+    Args.push_back(SaveStringInSet(SavedStrings, '-' + Edit));
+  } else {
+    OS << "### Unrecognized edit: " << Edit << "\n";
+  }
 }
 
 /// ApplyQAOverride - Apply a comma separate list of edits to the
@@ -156,7 +156,7 @@
 void ApplyQAOverride(std::vector<const char*> &Args, const char *OverrideStr,
                      std::set<std::string> &SavedStrings) {
   llvm::raw_ostream *OS = &llvm::errs();
-  
+
   if (OverrideStr[0] == '#') {
     ++OverrideStr;
     OS = &llvm::nulls();
@@ -203,7 +203,7 @@
 
     ApplyQAOverride(StringPointers, OverrideStr, SavedStrings);
 
-    C.reset(TheDriver.BuildCompilation(StringPointers.size(), 
+    C.reset(TheDriver.BuildCompilation(StringPointers.size(),
                                        &StringPointers[0]));
   } else if (const char *Cur = ::getenv("CCC_ADD_ARGS")) {
     std::vector<const char*> StringPointers;
@@ -213,7 +213,7 @@
 
     for (;;) {
       const char *Next = strchr(Cur, ',');
-      
+
       if (Next) {
         StringPointers.push_back(SaveStringInSet(SavedStrings,
                                                  std::string(Cur, Next)));
@@ -227,7 +227,7 @@
 
     StringPointers.insert(StringPointers.end(), argv + 1, argv + argc);
 
-    C.reset(TheDriver.BuildCompilation(StringPointers.size(), 
+    C.reset(TheDriver.BuildCompilation(StringPointers.size(),
                                        &StringPointers[0]));
   } else
     C.reset(TheDriver.BuildCompilation(argc, argv));





More information about the cfe-commits mailing list