llvm/flang/attr.h
Tim Keith 4a588883d2 [flang] Adapt to new directory for idioms.cc, idioms.h.
Change idioms.h so that calls to die will work outside the parser
namespace.

Use unordered_map to cache IntConst values.

Original-commit: flang-compiler/f18@9d06c385d9
Reviewed-on: https://github.com/flang-compiler/f18/pull/3
2018-02-07 15:19:54 -08:00

44 lines
746 B
C++

#ifndef FORTRAN_ATTR_H_
#define FORTRAN_ATTR_H_
#include "lib/parser/idioms.h"
#include <iostream>
#include <set>
#include <string>
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