[PATCH] D73307: Unique Names for Functions with Internal Linkage

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 23 23:02:12 PST 2020


MaskRay added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1111
+      this->getFunctionLinkage(GD) == llvm::GlobalValue::InternalLinkage) {
+    std::string UniqueSuffix = getUniqueModuleId(&getModule(), true);
+    if (!UniqueSuffix.empty()) {
----------------
`std::string llvm::getUniqueModuleId(Module *M) {`

What is the second parameter?

What is the rationale that InternalLinkage is picked here?


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:966
                                          OPT_fno_unique_section_names, true);
+  Opts.UniqueInternalFuncNames = Args.hasFlag(
+      OPT_funique_internal_funcnames, OPT_fno_unique_internal_funcnames, false);
----------------
Just `Args.hasArg(OPT_funique_internal_funcnames)`.

`-fno-*` is handled in clangDriver. CC1 does not need to know `-fno-*` if it defaults to false.


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

https://reviews.llvm.org/D73307





More information about the cfe-commits mailing list