[llvm] 0d81093 - [llvm] Remove calls to supportsTypedPointers() (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 14 00:38:09 PDT 2023
Author: Nikita Popov
Date: 2023-07-14T09:34:46+02:00
New Revision: 0d8109374248dac9aaeee2858cca3dd8d6ef3dbb
URL: https://github.com/llvm/llvm-project/commit/0d8109374248dac9aaeee2858cca3dd8d6ef3dbb
DIFF: https://github.com/llvm/llvm-project/commit/0d8109374248dac9aaeee2858cca3dd8d6ef3dbb.diff
LOG: [llvm] Remove calls to supportsTypedPointers() (NFC)
Always returns false now.
Added:
Modified:
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Transforms/Utils/ModuleUtils.cpp
Removed:
################################################################################
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index f754c185272fbe..466bdebc001f58 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -825,15 +825,7 @@ lltok::Kind LLLexer::LexIdentifier() {
TYPEKEYWORD("x86_mmx", Type::getX86_MMXTy(Context));
TYPEKEYWORD("x86_amx", Type::getX86_AMXTy(Context));
TYPEKEYWORD("token", Type::getTokenTy(Context));
-
- if (Keyword == "ptr") {
- if (Context.supportsTypedPointers()) {
- Warning("ptr type is only supported in -opaque-pointers mode");
- return lltok::Error;
- }
- TyVal = PointerType::getUnqual(Context);
- return lltok::Type;
- }
+ TYPEKEYWORD("ptr", PointerType::getUnqual(Context));
#undef TYPEKEYWORD
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 4f6c5f0a677e13..c31f2afadc516f 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2383,9 +2383,6 @@ Error BitcodeReader::parseTypeTableBody() {
case bitc::TYPE_CODE_OPAQUE_POINTER: { // OPAQUE_POINTER: [addrspace]
if (Record.size() != 1)
return error("Invalid opaque pointer record");
- if (Context.supportsTypedPointers())
- return error(
- "Opaque pointers are only supported in -opaque-pointers mode");
unsigned AddressSpace = Record[0];
ResultTy = PointerType::get(Context, AddressSpace);
break;
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index ecd64d8ca4a413..1e243ef74df7fd 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -394,9 +394,7 @@ bool llvm::lowerGlobalIFuncUsersAsGlobalCtor(
const DataLayout &DL = M.getDataLayout();
PointerType *TableEntryTy =
- Ctx.supportsTypedPointers()
- ? PointerType::get(Type::getInt8Ty(Ctx), DL.getProgramAddressSpace())
- : PointerType::get(Ctx, DL.getProgramAddressSpace());
+ PointerType::get(Ctx, DL.getProgramAddressSpace());
ArrayType *FuncPtrTableTy =
ArrayType::get(TableEntryTy, IFuncsToLower.size());
@@ -466,9 +464,7 @@ bool llvm::lowerGlobalIFuncUsersAsGlobalCtor(
InitBuilder.CreateRetVoid();
- PointerType *ConstantDataTy = Ctx.supportsTypedPointers()
- ? PointerType::get(Type::getInt8Ty(Ctx), 0)
- : PointerType::get(Ctx, 0);
+ PointerType *ConstantDataTy = PointerType::get(Ctx, 0);
// TODO: Is this the right priority? Probably should be before any other
// constructors?
More information about the llvm-commits
mailing list