[PATCH] D112868: [Sema] Diagnose and reject non-function ifunc resolvers

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 3 07:33:14 PDT 2021


erichkeane added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:320
 // linear structure.
 static const llvm::GlobalValue *getAliasedGlobal(const llvm::GlobalValue *GV) {
+  const llvm::Constant *C;
----------------
Can you explain a bit better how this change here works?  The previous version appears to have done quite a bit of work in the loop to look through aliases/ifuncs, and it seems we don't do that anymore?  


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:397
 
+    bool IsIFunc = isa<llvm::GlobalIFunc>(Alias);
     llvm::Constant *Aliasee =
----------------
What is the purpose of changing this from checking the declaration to the IR?  It seems that this is something we should be able to catch at the AST level and not have to revert to IR checks like this.


================
Comment at: clang/test/Sema/attr-ifunc.c:16
 
-void* f2_a() __attribute__((ifunc("f2_b")));
-//expected-error at -1 {{ifunc definition is part of a cycle}}
+void *f2_a() __attribute__((alias("f2_b")));
 void* f2_b() __attribute__((ifunc("f2_a")));
----------------
Did we lose this previous error?  We still want that to happen, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112868



More information about the cfe-commits mailing list