llvm/flang/attr.h
Tim Keith 59157ff1a5 [flang] Initial work on the representation of types.
Still work to do for derived types components, array specs, type-bound
procedures, etc.

Added executable type-test to the cmake file which exercises some of the
basic functionality. Modified the Makefile so that "make Debug" does a
cmake build.

Original-commit: flang-compiler/f18@02e8c4c867
Reviewed-on: https://github.com/flang-compiler/f18/pull/3
Tree-same-pre-rewrite: false
2018-02-06 16:46:29 -08:00

45 lines
736 B
C++

#ifndef FORTRAN_ATTR_H_
#define FORTRAN_ATTR_H_
#include <iostream>
#include <set>
#include <string>
#include "idioms.h"
namespace Fortran {
// All available attributes.
enum class Attr {
ABSTRACT,
ALLOCATABLE,
ASYNCHRONOUS,
BIND_C,
CONTIGUOUS,
EXTERNAL,
INTENT_IN,
INTENT_OUT,
INTRINSIC,
OPTIONAL,
PARAMETER,
POINTER,
PRIVATE,
PROTECTED,
PUBLIC,
SAVE,
TARGET,
VALUE,
VOLATILE,
};
using Attrs = std::set<Attr>;
std::ostream &operator<<(std::ostream &o, Attr attr);
std::ostream &operator<<(std::ostream &o, const Attrs &attrs);
// Report internal error if attrs is not a subset of allowed.
void checkAttrs(std::string className, Attrs attrs, Attrs allowed);
} // namespace Fortran
#endif