mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Add SILGlobalAddrInst.
Like GlobalAddrInst, but for SILGlobalVariables. These would become the same instruction when SILGlobalVariable can replace AST-level global references. Swift SVN r10510
This commit is contained in:
@@ -381,6 +381,15 @@ public:
|
||||
require(!GAI->getGlobal()->getDeclContext()->isLocalContext(),
|
||||
"GlobalAddr cannot take the address of a local var");
|
||||
}
|
||||
|
||||
void checkSILGlobalAddrInst(SILGlobalAddrInst *GAI) {
|
||||
require(GAI->getType().isAddress(),
|
||||
"SILGlobalAddr must have an address result type");
|
||||
require(GAI->getType().getObjectType() ==
|
||||
GAI->getReferencedGlobal()->getLoweredType(),
|
||||
"SILGlobalAddr must be the address type of the variable it "
|
||||
"references");
|
||||
}
|
||||
|
||||
void checkIntegerLiteralInst(IntegerLiteralInst *ILI) {
|
||||
require(ILI->getType().is<BuiltinIntegerType>(),
|
||||
|
||||
Reference in New Issue
Block a user