[flang] Initial buffer framing code
Address review comments
Integer output data editing (I,B,O,Z)
Full integer output formatting
Stub out some work in progress
Progress on E output data editing
E, D, EN, and ES output editing done
Fw.d output editing
Real G output editing
G output editing for reals
Make environment a distinct module
CHARACTER and LOGICAL output editing
Minimal decimal representations for E0, F0, G0 editing
Move real output editing code into its own file
Fix/dodge some GCC build problems
Prep work for external I/O statement state
External HELLO, WORLD
Fix build problem with GCC
Add virtual destructors where needed
Add new test
Original-commit: flang-compiler/f18@c3f1774f8eee903928b7e46636edfb03425eabc0
Reviewed-on: https://github.com/flang-compiler/f18/pull/950
diff --git a/flang/runtime/tools.h b/flang/runtime/tools.h
index 184f6af..d1b90b1 100644
--- a/flang/runtime/tools.h
+++ b/flang/runtime/tools.h
@@ -8,7 +8,12 @@
#ifndef FORTRAN_RUNTIME_TOOLS_H_
#define FORTRAN_RUNTIME_TOOLS_H_
+
#include "memory.h"
+#include <functional>
+#include <map>
+#include <type_traits>
+
namespace Fortran::runtime {
class Terminator;
@@ -21,5 +26,11 @@
// or -1 when it has no match.
int IdentifyValue(
const char *value, std::size_t length, const char *possibilities[]);
+
+// A std::map<> customized to use the runtime's memory allocator
+template<typename KEY, typename VALUE>
+using MapAllocator = Allocator<std::pair<std::add_const_t<KEY>, VALUE>>;
+template<typename KEY, typename VALUE, typename COMPARE = std::less<KEY>>
+using Map = std::map<KEY, VALUE, COMPARE, MapAllocator<KEY, VALUE>>;
}
#endif // FORTRAN_RUNTIME_TOOLS_H_