summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AVR/AVRISelLowering.cpp
diff options
context:
space:
mode:
authorDylan McKay <dylanmckay34@gmail.com>2017-02-05 09:53:45 +0000
committerDylan McKay <dylanmckay34@gmail.com>2017-02-05 09:53:45 +0000
commit7a3eb290efe22c2aef5fce8ffd06c5f7c314cfa5 (patch)
tree736adbb07ef48482db73fd71184ea327d34080b6 /llvm/lib/Target/AVR/AVRISelLowering.cpp
parent448b5790f62ddf002723b898ba4ac4e38649bdca (diff)
downloadbcm5719-llvm-7a3eb290efe22c2aef5fce8ffd06c5f7c314cfa5.tar.gz
bcm5719-llvm-7a3eb290efe22c2aef5fce8ffd06c5f7c314cfa5.zip
[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. llvm-svn: 294119
Diffstat (limited to 'llvm/lib/Target/AVR/AVRISelLowering.cpp')
-rw-r--r--llvm/lib/Target/AVR/AVRISelLowering.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/AVR/AVRISelLowering.cpp b/llvm/lib/Target/AVR/AVRISelLowering.cpp
index 07fc3f6890b..fa2a3918206 100644
--- a/llvm/lib/Target/AVR/AVRISelLowering.cpp
+++ b/llvm/lib/Target/AVR/AVRISelLowering.cpp
@@ -932,6 +932,12 @@ static void analyzeStandardArguments(TargetLowering::CallLoweringInfo *CLI,
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.
OpenPOWER on IntegriCloud