ahatanak added a comment.

The patch isn't fixing any serious bugs, but is fixing what seems to me 
inconsistencies in the code. It makes the following changes:

1. Currently, SetLLVMFunctionAttributes is called to add function attributes to 
the internal function definitions, but SetLLVMFunctionAttributes doesn't call 
SetLLVMFunctionAttributesForDefinition which should be called to add function 
attributes to function definitions (but not to declarations). This patch 
replaces calls to SetLLVMFunctionAttributes with calls to 
SetInternalFunctionAttributes, which I think is the right thing to do since the 
functions created are all internal functions.

2. Currently, CodeGenModule::CreateGlobalInitOrDestructFunction always passes a 
CGFunctionInfo instance for void() functions (created by 
arrangeNullaryFunction) to SetLLVMFunctionAttributes. Strictly speaking, this 
is not correct for CodeGenFunction::generateDestroyHelper (near line 582) 
because the function type is void(*void.). That's why I made changes to have 
the callers of CreateGlobalInitOrDestructFunction pass a reference to 
CGFunctionInfo.


http://reviews.llvm.org/D13610



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to