summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-09-15 09:20:34 +0000
committerTim Northover <tnorthover@apple.com>2016-09-15 09:20:34 +0000
commit5ae8350af67a26c694da82342e71036470084c21 (patch)
tree4a53c9b18b5f48c551d15fa6f0dbb9070cf4ba79 /llvm/lib/CodeGen/MIRParser/MIParser.cpp
parent97a3c35443da90a80d7aead1252a9492e5dea57a (diff)
downloadbcm5719-llvm-5ae8350af67a26c694da82342e71036470084c21.tar.gz
bcm5719-llvm-5ae8350af67a26c694da82342e71036470084c21.zip
GlobalISel: cache pointer sizes in LLT
Otherwise everything that needs to work out what size they are has to keep a DataLayout handy, which is a bit silly and very annoying. llvm-svn: 281597
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 2147651c4ef..6fb3d281be0 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -1048,7 +1048,9 @@ bool MIParser::parseLowLevelType(StringRef::iterator Loc, LLT &Ty) {
lex();
return false;
} else if (Token.is(MIToken::PointerType)) {
- Ty = LLT::pointer(APSInt(Token.range().drop_front()).getZExtValue());
+ const DataLayout &DL = MF.getFunction()->getParent()->getDataLayout();
+ unsigned AS = APSInt(Token.range().drop_front()).getZExtValue();
+ Ty = LLT::pointer(AS, DL.getPointerSizeInBits(AS));
lex();
return false;
}
OpenPOWER on IntegriCloud