diff options
Diffstat (limited to 'llvm/lib/AsmParser/LLLexer.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLLexer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp index 6048066..8aac5a6 100644 --- a/llvm/lib/AsmParser/LLLexer.cpp +++ b/llvm/lib/AsmParser/LLLexer.cpp @@ -860,7 +860,10 @@ lltok::Kind LLLexer::LexIdentifier() { TYPEKEYWORD("token", Type::getTokenTy(Context)); if (Keyword == "ptr") { - if (Context.supportsTypedPointers()) { + // enableOpaquePointers() must be called before creating any pointer types. + if (!Context.hasSetOpaquePointersValue()) { + Context.enableOpaquePointers(); + } else if (Context.supportsTypedPointers()) { Warning("ptr type is only supported in -opaque-pointers mode"); return lltok::Error; } |