[clang] [clang] Improve diagnostics for constraints of inline asm (NFC) (PR #96363)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 06:39:25 PDT 2024


================
@@ -2626,14 +2629,20 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
   SmallVector<TargetInfo::ConstraintInfo, 4> OutputConstraintInfos;
   SmallVector<TargetInfo::ConstraintInfo, 4> InputConstraintInfos;
 
+  const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(CurCodeDecl);
----------------
Sirraide wrote:

Yeah, I agree it seems weird to keep both around, and just outright removing one of them shouldn’t be too disruptive imo considering that it’s a fairly straight-forward change; I don’t know the history behind this too well, but do we want an RFC to decide on which one to remove, or is there already a clear favourite?

For what it’s worth, we currently have (at least according to grep, however accurate that may be) around 7900 occurrences of calls to functions ending with`cast_or_null` and around 530 ending with `cast_if_present` in the entire codebase.

https://github.com/llvm/llvm-project/pull/96363


More information about the cfe-commits mailing list