mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
[IR] Introduce a non-integral pointer type
Summary: This change adds a `ni` specifier in the `datalayout` string to denote pointers in some given address spaces as "non-integral", and adds some typing rules around these special pointers. Reviewers: majnemer, chandlerc, atrick, dberlin, eli.friedman, tstellarAMD, arsenm Subscribers: arsenm, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D22488 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277085 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -182,6 +182,7 @@ void DataLayout::reset(StringRef Desc) {
|
||||
BigEndian = false;
|
||||
StackNaturalAlign = 0;
|
||||
ManglingMode = MM_None;
|
||||
NonIntegralAddressSpaces.clear();
|
||||
|
||||
// Default alignments
|
||||
for (const LayoutAlignElem &E : DefaultAlignments) {
|
||||
@@ -234,6 +235,19 @@ void DataLayout::parseSpecifier(StringRef Desc) {
|
||||
StringRef &Tok = Split.first; // Current token.
|
||||
StringRef &Rest = Split.second; // The rest of the string.
|
||||
|
||||
if (Tok == "ni") {
|
||||
do {
|
||||
Split = split(Rest, ':');
|
||||
Rest = Split.second;
|
||||
unsigned AS = getInt(Split.first);
|
||||
if (AS == 0)
|
||||
report_fatal_error("Address space 0 can never be non-integral");
|
||||
NonIntegralAddressSpaces.push_back(AS);
|
||||
} while (!Rest.empty());
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
char Specifier = Tok.front();
|
||||
Tok = Tok.substr(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user