[llvm-commits] [gcc-plugin] r75345 - in /gcc-plugin/trunk: llvm-convert.cpp llvm-internal.h

Duncan Sands baldrick at free.fr
Fri Jul 10 21:05:21 PDT 2009


Author: baldrick
Date: Fri Jul 10 23:05:18 2009
New Revision: 75345

URL: http://llvm.org/viewvc/llvm-project?rev=75345&view=rev
Log:
Change "struct eh_region *" to the new eh_region typedef.

Modified:
    gcc-plugin/trunk/llvm-convert.cpp
    gcc-plugin/trunk/llvm-internal.h

Modified: gcc-plugin/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=75345&r1=75344&r2=75345&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-convert.cpp (original)
+++ gcc-plugin/trunk/llvm-convert.cpp Fri Jul 10 23:05:18 2009
@@ -1909,14 +1909,14 @@
 
 /// AddHandler - Append the given region to a vector of exception handlers.
 /// A callback passed to foreach_reachable_handler.
-static void AddHandler (struct eh_region *region, void *data) {
-  ((std::vector<struct eh_region *> *)data)->push_back(region);
+static void AddHandler (eh_region region, void *data) {
+  ((std::vector<eh_region> *)data)->push_back(region);
 }
 
 /// EmitLandingPads - Emit EH landing pads.
 void TreeToLLVM::EmitLandingPads() {
   std::vector<Value*> Args;
-  std::vector<struct eh_region *> Handlers;
+  std::vector<eh_region> Handlers;
 
   for (unsigned i = 1; i < LandingPads.size(); ++i) {
     BasicBlock *LandingPad = LandingPads[i];
@@ -1944,9 +1944,9 @@
     // Add selections for each handler.
     foreach_reachable_handler(i, false, AddHandler, &Handlers);
 
-    for (std::vector<struct eh_region *>::iterator I = Handlers.begin(),
+    for (std::vector<eh_region>::iterator I = Handlers.begin(),
          E = Handlers.end(); I != E; ++I) {
-      struct eh_region *region = *I;
+      eh_region region = *I;
 
       // Create a post landing pad for the handler.
       getPostPad(get_eh_region_number(region));
@@ -2022,7 +2022,7 @@
 
 /// EmitPostPads - Emit EH post landing pads.
 void TreeToLLVM::EmitPostPads() {
-  std::vector<struct eh_region *> Handlers;
+  std::vector<eh_region> Handlers;
 
   for (unsigned i = 1; i < PostPads.size(); ++i) {
     BasicBlock *PostPad = PostPads[i];
@@ -2034,7 +2034,7 @@
 
     EmitBlock(PostPad);
 
-    struct eh_region *region = get_eh_region(i);
+    eh_region region = get_eh_region(i);
     BasicBlock *Dest = getLabelDeclBlock(get_eh_region_tree_label(region));
 
     int RegionKind = classify_eh_handler(region);
@@ -2078,7 +2078,7 @@
 
       // If the comparion fails, branch to the next catch that has a
       // post landing pad.
-      struct eh_region *next_catch = get_eh_next_catch(region);
+      eh_region next_catch = get_eh_next_catch(region);
       for (; next_catch; next_catch = get_eh_next_catch(next_catch)) {
         unsigned CatchNo = get_eh_region_number(next_catch);
 
@@ -2107,7 +2107,7 @@
 
     BasicBlock *TargetBB = NULL;
 
-    for (std::vector<struct eh_region *>::iterator I = Handlers.begin(),
+    for (std::vector<eh_region>::iterator I = Handlers.begin(),
          E = Handlers.end(); I != E; ++I) {
       unsigned UnwindNo = get_eh_region_number(*I);
 
@@ -3742,12 +3742,12 @@
 /// EmitRESX_EXPR - Handle RESX_EXPR.
 Value *TreeToLLVM::EmitRESX_EXPR(tree exp) {
   unsigned RegionNo = TREE_INT_CST_LOW(TREE_OPERAND (exp, 0));
-  std::vector<struct eh_region *> Handlers;
+  std::vector<eh_region> Handlers;
 
   foreach_reachable_handler(RegionNo, true, AddHandler, &Handlers);
 
   if (!Handlers.empty()) {
-    for (std::vector<struct eh_region *>::iterator I = Handlers.begin(),
+    for (std::vector<eh_region>::iterator I = Handlers.begin(),
          E = Handlers.end(); I != E; ++I)
       // Create a post landing pad for the handler.
       getPostPad(get_eh_region_number(*I));

Modified: gcc-plugin/trunk/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=75345&r1=75344&r2=75345&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-internal.h (original)
+++ gcc-plugin/trunk/llvm-internal.h Fri Jul 10 23:05:18 2009
@@ -41,10 +41,6 @@
 #include "llvm/Support/Streams.h"
 #include "llvm/Support/TargetFolder.h"
 
-/// Internal gcc structure describing an exception handling region.  Declared
-/// here to avoid including all of except.h.
-struct eh_region;
-
 namespace llvm {
   class Module;
   class GlobalVariable;





More information about the llvm-commits mailing list