From ac6081cb672a5d6027b6dbdb8f9ca95aac9f4775 Mon Sep 17 00:00:00 2001 From: Nirav Dave Date: Sat, 18 Mar 2017 00:44:07 +0000 Subject: Make library calls sensitive to regparm module flag (Fixes PR3997). Reviewers: mkuper, rnk Subscribers: mehdi_amini, jyknight, aemerson, llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D27050 llvm-svn: 298179 --- llvm/lib/IR/Module.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/lib/IR/Module.cpp') diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index 1911f84340c..09dd2aa7b42 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -465,6 +465,14 @@ void Module::dropAllReferences() { GIF.dropAllReferences(); } +unsigned Module::getNumberRegisterParameters() const { + auto *Val = + cast_or_null(getModuleFlag("NumRegisterParameters")); + if (!Val) + return 0; + return cast(Val->getValue())->getZExtValue(); +} + unsigned Module::getDwarfVersion() const { auto *Val = cast_or_null(getModuleFlag("Dwarf Version")); if (!Val) -- cgit v1.2.3