File: process_omp.cc

package info (click to toggle)
opari 1.1%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 728 kB
  • sloc: cpp: 2,005; ansic: 901; f90: 252; makefile: 128; sh: 86; fortran: 50
file content (43 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*************************************************************************/
/* OPARI Version 1.1                                                     */
/* Copyright (C) 2001                                                    */
/* Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik */
/*************************************************************************/

#include <iostream>
#ifdef EBUG
   using std::cerr;

#  include <iomanip>
   using std::setw;
# endif

#include "opari.h"
#include "handler.h"

void process_pragma(OMPragma* p, ostream& os, bool* hasEnd, bool* isFor) {
# ifdef EBUG
  for (unsigned i=0; i<p->lines.size(); ++i)
    cerr << setw(3) << p->lineno+i << ":O" << (i?"+":" ")
         << ": " << p->lines[i] << "\n";
# endif
  p->find_name();

  if ( do_transform || p->name == "instrument" ) {
    if ( hasEnd )
      *hasEnd = (p->name != "barrier" && p->name != "noinstrument" &&
                 p->name != "flush"   &&
#if defined(__GNUC__) && (__GNUC__ < 3)
                 p->name.substr(0, 4) != "inst");
#else
                 p->name.compare(0, 4, "inst") != 0);
#endif
    if ( isFor  )
      *isFor  = (p->name == "for" || p->name == "parallelfor");
    phandler_t handler = find_handler(p->name);
    handler(p, os);
  } else {
    for (unsigned i=0; i<p->lines.size(); ++i) os << p->lines[i] << "\n";
  }
  delete p;
}