ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AstProcessing.h
Go to the documentation of this file.
1 // Original Author (AstProcessing classes): Markus Schordan
2 // Rewritten by: Gergo Barany
3 
4 #ifndef ASTPROCESSING_H
5 #define ASTPROCESSING_H
6 #define INHERITED 0
7 #define SYNTHESIZED 1
8 #define BOTH 2
9 
10 
11 
12 #ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
13  #include "staticCFG.h"
14 #endif
15 
16 #include <vector>
17 #include <algorithm>
18 #include <utility>
19 #include <iostream>
20 
21 //using namespace boost;
22 
23 //bool end = false;
24 
25 //using namespace std;
26 
27 // tps (01/08/2010) Added sage3basic since this doesnt compile under gcc4.1.2
28 //#include "sage3basic.h"
29 //#include "sage3.h"
30 // Non-templated helper function in AstProcessing.C
31 
32 
33 
34 
35 ROSE_DLL_API bool
36 SgTreeTraversal_inFileToTraverse(SgNode* node, bool traversalConstraint, SgFile* fileToVisit);
37 
38 /*
39  GB (06/01/2007):
40  Changes to the original code were roughly:
41  - removed unneeded includes and other code
42  - removed everything related to visit flags
43  - changed support for SynthesizedAttributesList; synthesized attributes are
44  now handled in a smarter way, by keeping them on a stack and (in
45  principle) only passing iterators instead of copying a container;
46  traverse() is now only a thin wrapper around performTraversal() that
47  takes care of visiting nodes and pushing/popping synthesized attributes
48  - rewrote inFileToTraverse() to use new AST features instead of lots of
49  string comparisons; it is now explicitly stated (at least in this
50  comment) that we *do* visit subtrees from other files unless their root
51  is in global or namespace scope, which is how we hope to avoid headers
52  but still handle all included "code"
53  - renamed class _DummyAttribute because that identifier is reserved for the
54  implementation
55  - everything that was not changed in some other way was totally
56  reformatted, so diffing the old and new files won't do anything
57  meaningful
58  - appended "" suffix to pretty much any global identifier that would
59  clash with the existing ones; if this code is ever moved into ROSE to
60  replace the old version, it should not be exceedingly hard to remove the
61  suffix everywhere
62  - added some new virtual functions the user may choose to implement:
63  atTraversalStart(), atTraversalEnd(), destroyInheritedValue()
64  - other stuff I have probably forgotten
65  GB (7/6/2007):
66  - added new class AstPrePostProcessing and changed the traverseOrder
67  flag so that it can now be pre and post order at the same time
68  */
69 
70 
71 
72 
73 
74 #include "AstSuccessorsSelectors.h"
76 
77 // This type is used as a dummy template parameter for those traversals
78 // that do not use inherited or synthesized attributes.
79 typedef void *DummyAttribute;
80 // We initialize DummyAttributes to this value to avoid "may not be
81 // initialized" warnings. If you change the typedef, adjust the constant...
83 // The attribute _DummyAttribute is reserved for the implementation, so we
84 // should deprecate it, but there is code using it explicitly. Which it
85 // shouldn't.
87 
88 
89 template <class InheritedAttributeType, class SynthesizedAttributeType>
91 
92 
93 
94 
95 // Base class for all traversals.
96 template <class InheritedAttributeType, class SynthesizedAttributeType>
98 {
99 public:
101 
102  SynthesizedAttributeType traverse(SgNode* basenode,
103  InheritedAttributeType inheritedValue,
104  t_traverseOrder travOrder = preandpostorder);
106  SynthesizedAttributeType traverseWithinFile(SgNode* basenode,
107  InheritedAttributeType inheritedValue,
110  void traverseInputFiles(SgProject* projectNode,
111  InheritedAttributeType inheritedValue,
113 
114  // Default destructor/constructor
115  virtual ~SgTreeTraversal();
116  SgTreeTraversal();
118  // Copy operations
122  friend class SgCombinedTreeTraversal<InheritedAttributeType, SynthesizedAttributeType>;
123 
127 protected:
128  virtual InheritedAttributeType evaluateInheritedAttribute(SgNode* astNode,
129  InheritedAttributeType inheritedValue) = 0;
131 
132  virtual SynthesizedAttributeType evaluateSynthesizedAttribute(SgNode* n,
133  InheritedAttributeType in,
136 
140  // GB (09/25/2007): Feel free to override this to implement custom traversals, but see the
141  // comment for set_useDefaultIndexBasedTraversal() below!
142  virtual void setNodeSuccessors(SgNode* node, SuccessorsContainer& succContainer);
143 
144  virtual SynthesizedAttributeType defaultSynthesizedAttribute(InheritedAttributeType inh);
146  // GB (06/04/2007): A new virtual function called at the start of the
147  // traversal, before any node is actually visited; can be used to
148  // compute attributes that may have changed since the constructor was
149  // executed, but are constant during the traversal itself. A no-op by
150  // default. If you don't know what you would use this for, ignore it.
151  virtual void atTraversalStart();
152  // GB (06/13/2007): Added this just for symmetry, not sure if it is
153  // useful, but it won't hurt to have it.
154  virtual void atTraversalEnd();
155 
156  // GB (09/25/2007): This flag determines whether the new index-based traversal mechanism or the more general
157  // mechanism based on successor containers is to be used. Indexing should be faster, but it would be quite hard to
158  // adapt it to the reverse traversal and other specialized traversals. Thus: This is true by default, and anybody
159  // who overrides setNodeSuccessors() *must* change this to false to force the traversal to use their custom
160  // successor container.
162 private:
163  void performTraversal(SgNode *basenode,
164  InheritedAttributeType inheritedValue,
165  t_traverseOrder travOrder);
166  SynthesizedAttributeType traversalResult();
167 
172  // stack of synthesized attributes; evaluateSynthesizedAttribute() is
173  // automagically called with the appropriate stack frame, which
174  // behaves like a non-resizable std::vector
176 };
179 
180 template <class InheritedAttributeType, class SynthesizedAttributeType>
182 
183 template <class InheritedAttributeType, class SynthesizedAttributeType>
185  : public SgTreeTraversal<InheritedAttributeType, SynthesizedAttributeType>
186 {
187 public:
191  // deprecated
195  SynthesizedAttributeType traverse(SgNode* node, InheritedAttributeType inheritedValue);
196 
197 
198 
200 
203  SynthesizedAttributeType traverseWithinFile(SgNode* node, InheritedAttributeType inheritedValue);
204 
206  friend class AstCombinedTopDownBottomUpProcessing<InheritedAttributeType, SynthesizedAttributeType>;
208 protected:
210  virtual InheritedAttributeType evaluateInheritedAttribute(SgNode* astNode,
211  InheritedAttributeType inheritedValue) = 0;
212 
217  virtual SynthesizedAttributeType evaluateSynthesizedAttribute(SgNode*,
218  InheritedAttributeType,
221 
222 
226  virtual void atTraversalStart();
227  virtual void atTraversalEnd();
228 };
230 template <class InheritedAttributeType>
233 template <class InheritedAttributeType>
236 template <class InheritedAttributeType>
238  : public SgTreeTraversal<InheritedAttributeType, DummyAttribute>
239 {
240 public:
245  void traverse(SgNode* node, InheritedAttributeType inheritedValue);
246 
247 
249  void traverseWithinFile(SgNode* node, InheritedAttributeType inheritedValue);
250 
251 
252  friend class AstCombinedTopDownProcessing<InheritedAttributeType>;
253  friend class DistributedMemoryAnalysisPreTraversal<InheritedAttributeType>;
254 
255 protected:
257  virtual InheritedAttributeType evaluateInheritedAttribute(SgNode* astNode,
258  InheritedAttributeType inheritedValue) = 0;
260 
264  virtual void atTraversalStart();
265  virtual void atTraversalEnd();
266  // GB (06/04/2007): This is a new virtual function, a no-op by
267  // default. It is called for every node, after its successors have
268  // been visited, with the inherited attribute computed at this node.
269  // The intention is to be able to free any memory (or other resources)
270  // allocated by evaluateInheritedAttribute().
271  virtual void destroyInheritedValue(SgNode*, InheritedAttributeType);
272 
273 private:
275  InheritedAttributeType inheritedValue,
278 
279  DummyAttribute defaultSynthesizedAttribute(InheritedAttributeType inh);
280 };
281 
282 template <class SynthesizedAttributeType>
284 
285 template <class InheritedAttributeType>
287 
288 template <class SynthesizedAttributeType>
290  : public SgTreeTraversal<DummyAttribute,SynthesizedAttributeType>
291 {
292 public:
295 
296  // deprecated
299 
302  SynthesizedAttributeType traverse(SgNode* node);
303 
306  SynthesizedAttributeType traverseWithinFile(SgNode* node);
307 
308 
310  void traverseInputFiles(SgProject* projectNode);
311 
312  friend class AstCombinedBottomUpProcessing<SynthesizedAttributeType>;
313  friend class DistributedMemoryAnalysisPostTraversal<SynthesizedAttributeType>;
314 
315 protected:
320  virtual SynthesizedAttributeType evaluateSynthesizedAttribute(SgNode*, SynthesizedAttributesList) = 0;
321 
326  virtual SynthesizedAttributeType defaultSynthesizedAttribute();
330  virtual void atTraversalStart();
331  virtual void atTraversalEnd();
332 
333 private:
335 
337  virtual SynthesizedAttributeType evaluateSynthesizedAttribute(SgNode* astNode, DummyAttribute inheritedValue, SynthesizedAttributesList l);
338 
340 
341  virtual SynthesizedAttributeType defaultSynthesizedAttribute(DummyAttribute inheritedValue);
342 };
344 // deprecated classes (provided for compatibility with existing user code - will be removed at some point in future)
347 
350 
353 
357 template <class InheritedAttributeType, class SynthesizedAttributeType>
358 class SgTopDownBottomUpProcessing : public AstTopDownBottomUpProcessing <InheritedAttributeType, SynthesizedAttributeType> {};
359 
361 template <class InheritedAttributeType>
362 class SgTopDownProcessing : public AstTopDownProcessing <InheritedAttributeType> {};
365 template <class SynthesizedAttributeType>
366 class SgBottomUpProcessing : public AstBottomUpProcessing <SynthesizedAttributeType> {};
368 // Original Author (AstProcessing classes): Markus Schordan
369 // Rewritten by: Gergo Barany
370 // $Id: AstProcessing.C,v 1.10 2008/01/25 02:25:48 dquinlan Exp $
371 
372 // For information about the changes introduced during the rewrite, see
373 // the comment in AstProcessing.h
374 
375 template<class InheritedAttributeType, class SynthesizedAttributeType>
376 void
379 {
381 }
383 
386 // The default constructor of the internal tree traversal class
387 template<class InheritedAttributeType, class SynthesizedAttributeType>
390  : useDefaultIndexBasedTraversal(true),
391  traversalConstraint(false),
392  fileToVisit(NULL),
393  synthesizedAttributes(new SynthesizedAttributesList())
394 {
395 }
397 #ifndef SWIG
398 // The destructor of the internal tree traversal class
399 template<class InheritedAttributeType, class SynthesizedAttributeType>
402 {
403  ROSE_ASSERT(synthesizedAttributes != NULL);
404  delete synthesizedAttributes;
405  synthesizedAttributes = NULL;
406 }
407 
409 #endif
410 
411 template<class InheritedAttributeType, class SynthesizedAttributeType>
414  : useDefaultIndexBasedTraversal(other.useDefaultIndexBasedTraversal),
415  traversalConstraint(other.traversalConstraint),
416  fileToVisit(other.fileToVisit),
417  synthesizedAttributes(other.synthesizedAttributes->deepCopy())
418 {
419 }
421 template<class InheritedAttributeType, class SynthesizedAttributeType>
425 {
426  useDefaultIndexBasedTraversal = other.useDefaultIndexBasedTraversal;
427  traversalConstraint = other.traversalConstraint;
428  fileToVisit = other.fileToVisit;
430  ROSE_ASSERT(synthesizedAttributes != NULL);
431  delete synthesizedAttributes;
432  synthesizedAttributes = other.synthesizedAttributes->deepCopy();
434  return *this;
435 }
437 template<class InheritedAttributeType, class SynthesizedAttributeType>
438 void
441 {
442  useDefaultIndexBasedTraversal = val;
443 }
445 // MS: 03/22/02ROSE/tests/roseTests/astProcessingTests/
446 // function to traverse all ASTs representing inputfiles (excluding include files),
447 template<class InheritedAttributeType, class SynthesizedAttributeType>
448 void
451  InheritedAttributeType inheritedValue,
452  t_traverseOrder travOrder)
453  {
454  const SgFilePtrList& fList = projectNode->get_fileList();
455 
456  // DQ (9/1/2008): It is observed that this prevents a SgProject from being built on the generated DOT file!
457  // We might want a better design to be used here or call the evaluation directly to force the handling of
458  // inherited and synthesized attributes on the SgProject. This detail effect the handling of multiple
459  // files on the command line (something we want to get a global perspective on if possible).
461  printf ("Warning: The traverseInputFiles() iteration over the file list prevents the evaluation of inherited and synthesized attributes on the SgProject IR node! \n");
463  for (SgFilePtrList::const_iterator fl_iter = fList.begin(); fl_iter != fList.end(); fl_iter++)
464  {
465  ROSE_ASSERT(*fl_iter != NULL);
466  traverseWithinFile((*fl_iter), inheritedValue, travOrder);
467  }
468  }
470 
473 
479 // MS: 04/25/02
480 template <class InheritedAttributeType, class SynthesizedAttributeType>
481 SynthesizedAttributeType
483 traverse(SgNode* node, InheritedAttributeType inheritedValue)
484 {
485  // this is now explicitly marked as a pre *and* post order traversal
487  ::traverse(node, inheritedValue, preandpostorder);
488 }
491 // MS: 04/25/02
492 template <class InheritedAttributeType, class SynthesizedAttributeType>
493 SynthesizedAttributeType
495 traverseWithinFile(SgNode* node, InheritedAttributeType inheritedValue)
496 {
497  // this is now explicitly marked as a pre *and* post order traversal
499 }
500 
505 // MS: 04/25/02
506 template <class InheritedAttributeType>
510  InheritedAttributeType inheritedValue,
512 {
513  // call the cleanup function
514  destroyInheritedValue(astNode, inheritedValue);
515  // return value is not used
517  return a;
518 }
521 // MS: 07/30/04
522 template <class InheritedAttributeType>
525 defaultSynthesizedAttribute(InheritedAttributeType inh)
526 {
527  // called but not used
529  return a;
530 }
532 // MS: 04/25/02
533 template <class InheritedAttributeType>
534 void
536 traverse(SgNode* node, InheritedAttributeType inheritedValue)
537 {
538  // "top down" is now marked as a pre *and* post order traversal because
539  // there is a post order component (the call to destroyInheritedAttribute)
541  ::traverse(node, inheritedValue, preandpostorder);
542 }
545 // MS: 09/30/02
546 template <class InheritedAttributeType>
547 void
549 traverseWithinFile(SgNode* node, InheritedAttributeType inheritedValue)
550 {
551  // "top down" is now marked as a pre *and* post order traversal because
552  // there is a post order component (the call to destroyInheritedAttribute)
554 }
560 
561 // MS: 04/25/02
562 template <class SynthesizedAttributeType>
566 {
567  /* called but not used */
569  return a;
570 }
572 
575 // MS: 30/07/04
576 template <class SynthesizedAttributeType>
579 {
580  // GB (8/6/2007): This can give "may not be initialized" warnings when
581  // compiling with optimization (because -O flags cause gcc to perform
582  // data-flow analysis). I wonder how this might be fixed.
583  SynthesizedAttributeType s = SynthesizedAttributeType();
584  return s;
585 }
587 // MS: 30/07/04
588 template <class SynthesizedAttributeType>
591 {
592  return defaultSynthesizedAttribute();
593 }
595 // MS: 04/25/02//ENDEDIT
596 template <class SynthesizedAttributeType>
599  DummyAttribute inheritedValue,
601 {
602  return evaluateSynthesizedAttribute(astNode, l);
603 }
605 
608 
609 // MS: 04/25/02
610 template <class SynthesizedAttributeType>
613 {
614 
615  static DummyAttribute da;
617  ::traverse(node, da, postorder);
619 }
620 
621 // MS: 04/25/02
622 template <class SynthesizedAttributeType>
625 {
626  static DummyAttribute da;
628 }
629 
632 // MS: 04/25/02
633 template <class SynthesizedAttributeType>
636 {
637  static DummyAttribute da;
638  // GB (8/6/2007): This is now a postorder traversal; this did not really
639  // matter until now, but now evaluateSynthesizedAttribute is only called
640  // for traversals that have the postorder bit set.
643 }
644 #ifdef _MSC_VER
645 //class BooleanQueryInheritedAttributeType;
646 #include "../astQuery/booleanQuery.h"
647 #include "../astQuery/booleanQueryInheritedAttribute.h"
648 #endif
649 // MS: 07/29/04
650 template <class InheritedAttributeType, class SynthesizedAttributeType>
652 defaultSynthesizedAttribute(InheritedAttributeType inh)
653 {
654  // we provide 'inh' but do not use it in the constructor of 's' to allow primitive types
655  SynthesizedAttributeType s = SynthesizedAttributeType();
656  return s;
657 }
659 // MS: 09/30/02
660 template <class InheritedAttributeType, class SynthesizedAttributeType>
661 SynthesizedAttributeType
664  InheritedAttributeType inheritedValue,
665  t_traverseOrder treeTraversalOrder)
666 {
667  // DQ (1/18/2006): debugging
668  ROSE_ASSERT(this != NULL);
669  traversalConstraint = true;
671  SgFile* filenode = isSgFile(node);
672  if (filenode == NULL)
673  {
674  if (node == NULL)
675  {
676  printf ("Error: traverseWithinFile(): (node should be non-null) node = %p \n",node);
677  }
678  else
679  {
680  // DQ (4/22/2014): This will fail if the input is specified as a SgProject.
681  printf ("Error: traverseWithinFile(): (node should be type SgFile) node = %p = %s \n",node,node->class_name().c_str());
682  }
683  }
684  ROSE_ASSERT(filenode != NULL); // this function will be extended to work with all nodes soon
686  // GB (05/30/2007): changed to a SgFile* instead of a file name,
687  // comparisons are much cheaper this way
688  fileToVisit = filenode;
689 
690  ROSE_ASSERT(SgTreeTraversal_inFileToTraverse(node, traversalConstraint, fileToVisit) == true);
691 
692  SynthesizedAttributeType synth = traverse(node, inheritedValue, treeTraversalOrder);
693  traversalConstraint = false;
694  return synth;
695 }
698 
700 // GB (06/31/2007): Wrapper function around the performT
701 //raversal()
702 // function that does the real work; when that function is done, we call
703 // traversalResult() to get the final result off the stack of synthesized
704 // attributes.
705 /*
706 template <class InheritedAttributeType>
707 DummyAttribute
708 AstTopDownProcessing<InheritedAttributeType>::
709 defaultSynthesizedAttribute(InheritedAttributeType inh)
710 {arentset.begin(); i != parentset.end(); i++) {
711  map<SgGraphNode*, InheritedAttribute
712  // called but not used
713  DummyAttribute a = defaultDummyAttribute;
714  return a;
715 }
716 */
717 template <class InheritedAttributeType, class SynthesizedAttributeType>
719 traverse(SgNode *node, InheritedAttributeType inheritedValue,
720  t_traverseOrder treeTraversalOrder)
721 {
722  // make sure the stack is empty
723  synthesizedAttributes->resetStack();
724  ROSE_ASSERT(synthesizedAttributes->debugSize() == 0);
725 
726  // notify the concrete traversal class that a traversal is starting
727  atTraversalStart();
728 
729  // perform the actual traversal
730  performTraversal(node, inheritedValue, treeTraversalOrder);
731 
732  // notify the traversal that we are done
733  atTraversalEnd();
734 
735  // get the result off the stack
736  return traversalResult();
737 }
740 
741 template<class InheritedAttributeType, class SynthesizedAttributeType>
742 void
745  InheritedAttributeType inheritedValue,
746  t_traverseOrder treeTraversalOrder)
747  {
748  //cout << "In SgNode version" << endl;
749  // 1. node can be a null pointer, only traverse it if !
751  // (since the SuccessorContainer is order preserving we require 0 values as well!)
752  // 2. inFileToTraverse is false if we are trying to go to a different file (than the input file)
753  // and only if traverseInputFiles was invoked, otherwise it's always true
755  if (node && SgTreeTraversal_inFileToTraverse(node, traversalConstraint, fileToVisit))
756  {
757  // In case of a preorder traversal call the function to be applied to each node of the AST
758  // GB (7/6/2007): Because AstPrePostProcessing was introduced, a
759  // treeTraversalOrder can now be pre *and* post at the same time! The
760  // == comparison was therefore replaced by a bit mask check.
761  if (treeTraversalOrder & preorder)
762  inheritedValue = evaluateInheritedAttribute(node, inheritedValue);
763 
764  // Visit the traversable data members of this AST node.
765  // GB (09/25/2007): Added support for index-based traversals. The useDefaultIndexBasedTraversal flag tells us
766  // whether to use successor containers or direct index-based access to the node's successors.
768  size_t numberOfSuccessors;
769  if (!useDefaultIndexBasedTraversal)
770  {
771  setNodeSuccessors(node, succContainer);
772  numberOfSuccessors = succContainer.size();
773  }
774  else
775  {
776  numberOfSuccessors = node->get_numberOfTraversalSuccessors();
777  }
779  for (size_t idx = 0; idx < numberOfSuccessors; idx++)
780  {
781  SgNode *child = NULL;
782 
783  if (useDefaultIndexBasedTraversal)
784  {
785  // ROSE_ASSERT(node->get_traversalSuccessorByIndex(idx) != NULL || node->get_traversalSuccessorByIndex(idx) == NULL);
786  child = node->get_traversalSuccessorByIndex(idx);
788  // DQ (4/21/2014): Valgrind test to isolate uninitialised read reported where child is read below.
789  ROSE_ASSERT(child == NULL || child != NULL);
790  }
791  else
792  {
793  // ROSE_ASSERT(succContainer[idx] != NULL || succContainer[idx] == NULL);
794  child = succContainer[idx];
796  // DQ (4/21/2014): Valgrind test to isolate uninitialised read reported where child is read below.
797  ROSE_ASSERT(child == NULL || child != NULL);
798  }
800  if (child != NULL)
801  {
802 
803 
804 
805  performTraversal(child, inheritedValue, treeTraversalOrder);
806 
807 
808 
809  //ENDEDIT
810  }
811  else
812  {
813  // null pointer (not traversed): we put the default value(s) of SynthesizedAttribute onto the stack
814  if (treeTraversalOrder & postorder)
815  synthesizedAttributes->push(defaultSynthesizedAttribute(inheritedValue));
816  }
817  }
818 
819  // In case of a postorder traversal call the function to be applied to each node of the AST
820  // GB (7/6/2007): Because AstPrePostProcessing was introduced, a
821  // treeTraversalOrder can now be pre *and* post at the same time! The
822  // == comparison was therefore replaced by a bit mask check.
823  // The call to evaluateInheritedAttribute at this point also had to be
824  // changed; it was never elegant anyway as we were not really
825  // evaluating attributes here.
826  if (treeTraversalOrder & postorder)
827  {
828  // Now that every child's synthesized attributes are on the stack:
829  // Tell the stack how big the stack frame containing those
830  // attributes is to be, and pass that frame to
831  // evaluateSynthesizedAttribute(); then replace those results by
832  // pushing the computed value onto the stack (which pops off the
833  // previous stack frame).
834  synthesizedAttributes->setFrameSize(numberOfSuccessors);
835  ROSE_ASSERT(synthesizedAttributes->size() == numberOfSuccessors);
836  synthesizedAttributes->push(evaluateSynthesizedAttribute(node, inheritedValue, *synthesizedAttributes));
837  }
838  }
839  else // if (node && inFileToTraverse(node))
840  {
841  if (treeTraversalOrder & postorder)
842  synthesizedAttributes->push(defaultSynthesizedAttribute(inheritedValue));
843  }
844  } // function body
845 
847 // GB (05/30/2007)
848 template <class InheritedAttributeType, class SynthesizedAttributeType>
851 {
852  // If the stack of synthesizedAttributes contains exactly one object, then
853  // that one is the valid final result of the computation, so we should
854  // return it. Otherwise, either there are no objects on the stack (because
855  // the traversal didn't use any attributes), or there are more than one
856  // (usually because the traversal exited prematurely by throwing an
857  // exception); in this case, just return a default attribute.
858  if (synthesizedAttributes->debugSize() == 1)
859  {
860  return synthesizedAttributes->pop();
861  }
862  else
863  {
864  static SynthesizedAttributeType sa;
865  return sa;
866  }
867 }
869 
870 // GB (05/30/2007)
871 template <class InheritedAttributeType, class SynthesizedAttributeType>
872 void
875 {
876 }
878 template <class InheritedAttributeType, class SynthesizedAttributeType>
879 void
882 {
883 }
884 /*
885 template <class InheritedAttributeType, class SynthesizedAttributeType>
886 void
887 SgTreeTraversal<InheritedAttributeType, SynthesizedAttributeType>::
888 afterSingleTraversal()
889 {
890 }
892 template <class InheritedAttributeType, class SynthesizedAttributeType>
893 void
894 SgTreeTraversal<InheritedAttributeType, SynthesizedAttributeType>::
896 beforeSingleTraversal()
897 {
898 }
899 */
901 template <class InheritedAttributeType, class SynthesizedAttributeType>
902 void
905 {
906 }
908 template <class InheritedAttributeType, class SynthesizedAttributeType>
909 void
912 {
913 }
914 
915 template <class InheritedAttributeType>
916 void
918 destroyInheritedValue(SgNode*, InheritedAttributeType)
919 {
920 }
922 template <class InheritedAttributeType>
923 void
926 {
927 }
929 template <class InheritedAttributeType>
930 void
933 {
934 }
935 
936 template <class SynthesizedAttributeType>
937 void
940 {
941 }
943 template <class SynthesizedAttributeType>
944 void
947 {
948 }
949 // #endif
950 
951 #include "AstSimpleProcessing.h" // that's a non-templated class which is put in a different file (for gcc to compile&link properly)
953 #include "AstCombinedProcessing.h"
955 // DQ (3/20/2009): Wrap this in a test to make sure that Cygwin is not being used.
956 // This causes a problem:
957 // error: there are no arguments to �cvLoadImage� that depend on a template parameter, so a declaration of <function name> must be available
958 // which requires:
959 // -fpermissive to compile without error (and then it generates a lot of warnings).
960 #if !_MSC_VER
962 #endif
964 #endif