[PATCH] D35479: [CodeGen][mips] Support `long_call/far/near` attributes

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 15:39:28 PDT 2017

rjmccall added inline comments.

Comment at: lib/CodeGen/TargetInfo.cpp:2356
+  X86_32TargetCodeGenInfo::setTargetAttributes(D, GV, CGM, IsForDefinition);
   addStackProbeSizeTargetAttribute(D, GV, CGM);
No, sorry, I must not have been clear.  We still need a check here, but we should do it after the first call.

The idea is that we want to give the generic x86-32 target an opportunity to add target attributes, whether this is a declaration or a definition.  , Having done that, we come back to this function to add any Windows-specific target attributes.  Since all the Windows-specific attributes are definition-only, we can just exit if it's only for a declaration.

Comment at: lib/CodeGen/TargetInfo.cpp:5534
+    ForDefinition_t IsForDefinition) const {
+  ARMTargetCodeGenInfo::setTargetAttributes(D, GV, CGM, IsForDefinition);
   addStackProbeSizeTargetAttribute(D, GV, CGM);
Same thing here: please add a check, but only after you've given the generic ARM target an opportunity to set attributes in all cases.



More information about the cfe-commits mailing list