[llvm] r294119 - [AVR] Support zero-sized arguments in defined methods
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 5 01:53:47 PST 2017
Author: dylanmckay
Date: Sun Feb 5 03:53:45 2017
New Revision: 294119
URL: http://llvm.org/viewvc/llvm-project?rev=294119&view=rev
Log:
[AVR] Support zero-sized arguments in defined methods
It is sufficient to skip emission of these arguments as we have nothing
to actually pass through the function call.
The AVR-GCC reference has nothing to say about zero-sized arguments,
presumably because C/C++ doesn't support them. This means we don't have
to worry about ABI differences.
Modified:
llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp
Modified: llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp?rev=294119&r1=294118&r2=294119&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp Sun Feb 5 03:53:45 2017
@@ -932,6 +932,12 @@ static void analyzeStandardArguments(Tar
bool UsesStack = false;
for (unsigned i = 0, pos = 0, e = Args.size(); i != e; ++i) {
unsigned Size = Args[i];
+
+ // If we have a zero-sized argument, don't attempt to lower it.
+ // AVR-GCC does not support zero-sized arguments and so we need not
+ // worry about ABI compatibility.
+ if (Size == 0) continue;
+
MVT LocVT = (IsCall) ? (*Outs)[pos].VT : (*Ins)[pos].VT;
// If we have plenty of regs to pass the whole argument do it.
More information about the llvm-commits
mailing list