[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Tue May 25 14:41:01 PDT 2004


Changes in directory llvm-java/lib/Compiler:

Compiler.cpp updated: 1.23 -> 1.24

---
Log message:

Create default branch entry last in a switch statement.


---
Diffs of the changes:  (+3 -3)

Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.23 llvm-java/lib/Compiler/Compiler.cpp:1.24
--- llvm-java/lib/Compiler/Compiler.cpp:1.23	Tue May 25 13:35:06 2004
+++ llvm-java/lib/Compiler/Compiler.cpp	Tue May 25 14:38:05 2004
@@ -93,15 +93,15 @@
         void do_switch(unsigned bcI,
                        unsigned defTarget,
                        const SwitchCases& sw) {
-            if (!bc2bbMap_[defTarget])
-                bc2bbMap_[defTarget] =
-                    new BasicBlock("bb at bc" + utostr(defTarget), &function_);
             for (unsigned i = 0; i < sw.size(); ++i) {
                 unsigned target = sw[i].second;
                 if (!bc2bbMap_[target])
                     bc2bbMap_[target] =
                         new BasicBlock("bb at bc" + utostr(target), &function_);
             }
+            if (!bc2bbMap_[defTarget])
+                bc2bbMap_[defTarget] =
+                    new BasicBlock("bb at bc" + utostr(defTarget), &function_);
         }
 
     private:





More information about the llvm-commits mailing list