[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

Devin Coughlin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 09:26:38 PDT 2017


dcoughlin added inline comments.


================
Comment at: include/clang/AST/Decl.h:53
 class VarTemplateDecl;
+class CompilerInstance;
 
----------------
Is this needed? It seems like a layering violation.


================
Comment at: include/clang/AST/Mangle.h:59
+  // the static analyzer.
+  bool ShouldForceMangleProto;
 
----------------
I'm pretty worried about using C++ mangling for C functions. It doesn't ever seem appropriate to do so and it sounds like it is papering over problems with the design.

Some questions:
- How do you handle when two translation units have different C functions with the same type signatures? Is there a collision? This can arise because of two-level namespacing or when building multiple targets with the same CTU directory.
- How do you handle when a C function has the same signature as a C++ function. Is there a collision when you mangle the C function?


https://reviews.llvm.org/D30691





More information about the cfe-commits mailing list