llvm/flang/lib/semantics/attr.h
Tim Keith e065e5b510 [flang] Move type.{h,cc} and attr.{h,cc}
The are now in new namespace and directory, "semantics", similar to
"parser".

Original-commit: flang-compiler/f18@115a1341e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/5
2018-02-07 15:54:07 -08:00

46 lines
793 B
C++

#ifndef FORTRAN_ATTR_H_
#define FORTRAN_ATTR_H_
#include "../parser/idioms.h"
#include <iostream>
#include <set>
#include <string>
namespace Fortran {
namespace semantics {
// 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 semantics
} // namespace Fortran
#endif