[llvm] d2be4f9 - [OpaquePtr][LLParser] Explicitly turn off opaque pointers if we see a star

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 08:42:59 PDT 2022


Author: Arthur Eubanks
Date: 2022-05-17T08:40:18-07:00
New Revision: d2be4f95494e642b72852cc33e69a47016fe4a23

URL: https://github.com/llvm/llvm-project/commit/d2be4f95494e642b72852cc33e69a47016fe4a23
DIFF: https://github.com/llvm/llvm-project/commit/d2be4f95494e642b72852cc33e69a47016fe4a23.diff

LOG: [OpaquePtr][LLParser] Explicitly turn off opaque pointers if we see a star

If we turn on --opaque-pointers, tests with '*' would use opaque pointers.

Can't really test this without flipping the default value for --opaque-pointers.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D125735

Added: 
    

Modified: 
    llvm/lib/AsmParser/LLParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index c723d71b744c9..d6d8743e13f3b 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -66,6 +66,8 @@ static void setContextOpaquePointers(LLLexer &L, LLVMContext &C) {
     // explicit "ptr".
     if (K == lltok::star || K == lltok::Error || K == lltok::Eof ||
         isa_and_nonnull<PointerType>(L.getTyVal())) {
+      if (K == lltok::star)
+        C.setOpaquePointers(false);
       return;
     }
   }


        


More information about the llvm-commits mailing list