Skip to content
Snippets Groups Projects
Commit f960f4d0 authored by Prakalp Srivastava's avatar Prakalp Srivastava
Browse files

Added a patch approved in future llvm branches which stop argument promotion...

Added a patch approved in future llvm branches which stop argument promotion for variagic functions. This was required to stop auto promotion of arguments in __visc__ calls
parent 4dd07d72
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,13 @@ CallGraphNode *ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
// Make sure that it is local to this module.
if (!F || !F->hasLocalLinkage()) return 0;
// Don't promote arguments for variadic functions. Adding, removing, or
// changing non-pack parameters can change the classification of pack
// parameters. Frontends encode that classification at the call site in the
// IR, while in the callee the classification is determined dynamically
// on the number of registers consumed so far.
if (F->isVarArg()) return nullptr;
// First check: see if there are any pointer arguments! If not, quick exit.
SmallVector<std::pair<Argument*, unsigned>, 16> PointerArgs;
unsigned ArgNo = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment