[PATCH] D107141: [Inline-asm] Add diagnosts for unsupported inline assembly arguments

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 22 08:13:45 PDT 2022


pengfei added inline comments.


================
Comment at: clang/lib/Sema/SemaStmtAsm.cpp:622
+    if (InTy->isIntegerType() || InTy->isPointerType() ||
+        InTy->isStructureType() || InTy->isConstantArrayType())
       InputDomain = AD_Int;
----------------
jyu2 wrote:
> pengfei wrote:
> > jyu2 wrote:
> > > Are you sure you want to change the Input/output Domain?  Since you changed this, could you add both codegen and sema check tests for  struct type(you already has sema check for struct type, but I don't see any array type) and array type.  
> > > 
> > > Thanks.
> > > Jennifer
> > The input / output domain are just for sema check here. I don't think it changes codegen behavior.
> Yes, for seam check, once error emit, compiler stop at CodeGen.  However, if no error emit, compiler will go though the CodeGen.
> 
> Since pointer/struct and constantArray are allowed for small size of type, so would you please add code gen test for that?
> 
> In your test where no-error should emit part...
> 
> asm ("" : "=rm" (a): "0" (1)); // no-error
> 
> Thanks.
> Jennifer
Thanks Jennifer! I see your point. I'll only add sema check (rather than loose in some way) in this patch.
The codegen part is complicated, some cases will pass but some still fail. I have left comments in the tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107141/new/

https://reviews.llvm.org/D107141



More information about the cfe-commits mailing list