ORC @ SourceForge.net Logo

last updated:Feb 22 , 2002

 

Coding conventions and guideline for Open Research Compiler

 

StyleWhile personal programming style (methods of commenting, use of identifiers, spacing and so on) is of course a highly personal issue and many electrons have been wasted arguing about the naturally "best" way. It is important to preserve the overall consistency of style in a given file and the whole component within the compiler. Style should also be evolving. Outdated styles should also be migrated whenever time/opportunity allows.

Don't

Data Type and Name

 Headers

As per other languages, header files are the black box documentation (interface) of your code, to be used by anyone calling your code. The usual caveats for such information apply as well as the following :

Memory Usage

The compiler is designed to take advantage of  the fact that compilation has known phase ordering  so that entire chunks of memory can be totally freed upon completion of a specific phase. A memory pool push/pop mechanism is designed to manage memory usage on top of STL's segmented array.

         MEM_POOL_Push(&your_local_pool);
        {
            some_type x(&your_local_pool);
            ...
        }
        MEM_POOL_Pop(&your_local_pool);

Class definition

class COMP_UNIT {
private:
  COMP_UNIT(void);
  COMP_UNIT(const COMP_UNIT&);
  COMP_UNIT& operator = (const COMP_UNIT);
   ...
};
#define Set_XXX(y)    (XXX(y) != SOME_FLAG)

Misc

//-*-c++-*-