[PATCH] D59016: [TableGen] Allow 2^63-1 and 2^63-2 as int literals.
Simon Tatham via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 02:55:20 PDT 2019
simon_tatham updated this revision to Diff 190055.
simon_tatham added a comment.
Simpler version that just replaces `DenseMap` with `std::map`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59016/new/
https://reviews.llvm.org/D59016
Files:
llvm/lib/TableGen/Record.cpp
llvm/test/TableGen/IntSpecialValues.td
Index: llvm/test/TableGen/IntSpecialValues.td
===================================================================
--- /dev/null
+++ llvm/test/TableGen/IntSpecialValues.td
@@ -0,0 +1,8 @@
+// RUN: llvm-tblgen %s | FileCheck %s
+
+def TestRecord {
+ // CHECK: int X = 9223372036854775807;
+ int X = 0x7FFFFFFFFFFFFFFF;
+ // CHECK: int Y = 9223372036854775806;
+ int Y = 0x7FFFFFFFFFFFFFFE;
+}
Index: llvm/lib/TableGen/Record.cpp
===================================================================
--- llvm/lib/TableGen/Record.cpp
+++ llvm/lib/TableGen/Record.cpp
@@ -32,6 +32,7 @@
#include <cassert>
#include <cstdint>
#include <memory>
+#include <map>
#include <string>
#include <utility>
#include <vector>
@@ -457,7 +458,7 @@
}
IntInit *IntInit::get(int64_t V) {
- static DenseMap<int64_t, IntInit*> ThePool;
+ static std::map<int64_t, IntInit*> ThePool;
IntInit *&I = ThePool[V];
if (!I) I = new(Allocator) IntInit(V);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59016.190055.patch
Type: text/x-patch
Size: 944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190311/eb357fb3/attachment.bin>
More information about the llvm-commits
mailing list