Skip to content

Commit 5139c90

Browse files
committed
[LLParser] Avoid PointerType::get() with type argument (NFC)
Use the methods accepting LLVMContext instead.
1 parent 1be64c2 commit 5139c90

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,7 @@ bool LLParser::parseType(Type *&Result, const Twine &Msg, bool AllowVoid) {
29752975
return tokError("pointers to void are invalid - use i8* instead");
29762976
if (!PointerType::isValidElementType(Result))
29772977
return tokError("pointer to this type is invalid");
2978-
Result = PointerType::getUnqual(Result);
2978+
Result = PointerType::getUnqual(Context);
29792979
Lex.Lex();
29802980
break;
29812981

@@ -2992,7 +2992,7 @@ bool LLParser::parseType(Type *&Result, const Twine &Msg, bool AllowVoid) {
29922992
parseToken(lltok::star, "expected '*' in address space"))
29932993
return true;
29942994

2995-
Result = PointerType::get(Result, AddrSpace);
2995+
Result = PointerType::get(Context, AddrSpace);
29962996
break;
29972997
}
29982998

@@ -6515,7 +6515,7 @@ bool LLParser::parseFunctionHeader(Function *&Fn, bool IsDefine,
65156515
return error(RetTypeLoc, "functions with 'sret' argument must return void");
65166516

65176517
FunctionType *FT = FunctionType::get(RetType, ParamTypeList, IsVarArg);
6518-
PointerType *PFT = PointerType::get(FT, AddrSpace);
6518+
PointerType *PFT = PointerType::get(Context, AddrSpace);
65196519

65206520
Fn = nullptr;
65216521
GlobalValue *FwdFn = nullptr;
@@ -7410,7 +7410,7 @@ bool LLParser::parseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
74107410

74117411
// Look up the callee.
74127412
Value *Callee;
7413-
if (convertValIDToValue(PointerType::get(Ty, InvokeAddrSpace), CalleeID,
7413+
if (convertValIDToValue(PointerType::get(Context, InvokeAddrSpace), CalleeID,
74147414
Callee, &PFS))
74157415
return true;
74167416

@@ -7724,7 +7724,8 @@ bool LLParser::parseCallBr(Instruction *&Inst, PerFunctionState &PFS) {
77247724

77257725
// Look up the callee.
77267726
Value *Callee;
7727-
if (convertValIDToValue(PointerType::getUnqual(Ty), CalleeID, Callee, &PFS))
7727+
if (convertValIDToValue(PointerType::getUnqual(Context), CalleeID, Callee,
7728+
&PFS))
77287729
return true;
77297730

77307731
// Set up the Attribute for the function.
@@ -8115,8 +8116,8 @@ bool LLParser::parseCall(Instruction *&Inst, PerFunctionState &PFS,
81158116

81168117
// Look up the callee.
81178118
Value *Callee;
8118-
if (convertValIDToValue(PointerType::get(Ty, CallAddrSpace), CalleeID, Callee,
8119-
&PFS))
8119+
if (convertValIDToValue(PointerType::get(Context, CallAddrSpace), CalleeID,
8120+
Callee, &PFS))
81208121
return true;
81218122

81228123
// Set up the Attribute for the function.

0 commit comments

Comments
 (0)