Skip to content

Instantly share code, notes, and snippets.

@brainlag
Created February 17, 2018 19:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brainlag/51928996f539bfafcfe0531e5dfd6236 to your computer and use it in GitHub Desktop.
Save brainlag/51928996f539bfafcfe0531e5dfd6236 to your computer and use it in GitHub Desktop.
Index: lib/Target/AVR/AVRISelLowering.cpp
===================================================================
--- lib/Target/AVR/AVRISelLowering.cpp (revision 325378)
+++ lib/Target/AVR/AVRISelLowering.cpp (working copy)
@@ -867,10 +867,11 @@
/// For each argument in a function store the number of pieces it is composed
/// of.
-static void parseFunctionArgs(const Function *F, const DataLayout *TD,
+static void parseFunctionArgs(const SmallVectorImpl<ISD::InputArg> &Ins,
SmallVectorImpl<unsigned> &Out) {
- for (Argument const &Arg : F->args()) {
- unsigned Bytes = (TD->getTypeSizeInBits(Arg.getType()) + 7) / 8;
+ for (const ISD::InputArg &Arg : Ins) {
+ if(Arg.PartOffset > 0) continue;
+ unsigned Bytes = ((Arg.ArgVT.getSizeInBits()) + 7) / 8;
Out.push_back((Bytes + 1) / 2);
}
}
@@ -938,7 +939,7 @@
parseExternFuncCallArgs(*Outs, Args);
} else {
assert(F != nullptr && "function should not be null");
- parseFunctionArgs(F, TD, Args);
+ parseFunctionArgs(*Ins, Args);
}
unsigned RegsLeft = array_lengthof(RegList8), ValNo = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment