[PATCH] D11297: PR17829: Functions declared extern "C" with a name matching a mangled C++ function are allowed

John McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 12 21:08:05 PDT 2015

rjmccall added a comment.

You only have one attempt to define the function here; I don't see the problem.  Recall that I said to add a flag to getOrCreateLLVMFunction that says whether the caller intends to define the function.  The rule should be that only callers that pass "true" should be allowed to assume that they'll get a normal llvm::Function back.  Everybody needs to be prepared to receive a bitcast.  Whenever you find yourself needing to replace an existing function, just queue it up to be replaced at the end of IRGen.

I don't think we need to fall over ourselves ensuring that these "aliased" uses properly mark functions as used or instantiate templates or anything.


More information about the cfe-commits mailing list