Fix some warnings reported by gcc-4.3. Hopefully
authorDuncan Sands <baldrick@free.fr>
Thu, 19 Jun 2008 08:47:31 +0000 (08:47 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 19 Jun 2008 08:47:31 +0000 (08:47 +0000)
this still compiles on windows - I can't test!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52488 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ValueTracking.cpp
tools/llvm-stub/llvm-stub.c

index 7b87cb62da0e9d868fabf7132c3134c5cf3ba702..32a77e6f4610bb2c2ce3c25a374045d33d443807 100644 (file)
@@ -871,7 +871,7 @@ Value *llvm::FindInsertedValue(Value *V, const unsigned *idx_begin,
     const unsigned *req_idx = idx_begin;
     for (const unsigned *i = I->idx_begin(), *e = I->idx_end();
          i != e; ++i, ++req_idx) {
-      if (req_idx == idx_end)
+      if (req_idx == idx_end) {
         if (InsertBefore)
           // The requested index identifies a part of a nested aggregate. Handle
           // this specially. For example,
@@ -887,6 +887,7 @@ Value *llvm::FindInsertedValue(Value *V, const unsigned *idx_begin,
         else
           // We can't handle this without inserting insertvalues
           return 0;
+      }
       
       // This insert value inserts something else than what we are looking for.
       // See if the (aggregrate) value inserted into has the value we are
index 91537a0b9cc7d388d6706d795fc1b35a59934da4..18d20e7d0c9f8bea0be0d604864a38ea92f64f17 100644 (file)
@@ -38,7 +38,6 @@
 int main(int argc, char** argv) {
   const char *Interp = getenv("LLVMINTERP");
   const char **Args;
-  int len;
   if (Interp == 0) Interp = "lli";
 
   /* Set up the command line options to pass to the JIT. */
@@ -47,12 +46,14 @@ int main(int argc, char** argv) {
   Args[0] = Interp;
 
 #ifdef LLVM_ON_WIN32
-  len = strlen(argv[0]);
-  if (len < 4 || strcmp(argv[0] + len - 4, ".exe") != 0) {
-    /* .exe suffix is stripped off of argv[0] if the executable was run on the
-     * command line without one. Put it back on.
-     */
-    argv[0] = strcat(strcpy((char*)malloc(len + 5), argv[0]), ".exe");
+  {
+    int len = strlen(argv[0]);
+    if (len < 4 || strcmp(argv[0] + len - 4, ".exe") != 0) {
+      /* .exe suffix is stripped off of argv[0] if the executable was run on the
+       * command line without one. Put it back on.
+       */
+      argv[0] = strcat(strcpy((char*)malloc(len + 5), argv[0]), ".exe");
+    }
   }
 #endif