Commit 8bd8e908 authored by Tom Stellard's avatar Tom Stellard
Browse files

Merging r298177:

------------------------------------------------------------------------
r298177 | niravd | 2017-03-17 20:43:39 -0400 (Fri, 17 Mar 2017) | 7 lines

[X86] Add NumRegisterParameters Module Flag.

Reviewers: rnk, mkuper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D27051
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@304294 91177308-0d34-0410-b5e6-96231b3b80d8
parent 476b6541
......@@ -159,6 +159,12 @@ CodeGenModule::CodeGenModule(ASTContext &C, const HeaderSearchOptions &HSO,
// CoverageMappingModuleGen object.
if (CodeGenOpts.CoverageMapping)
CoverageMapping.reset(new CoverageMappingModuleGen(*this, *CoverageInfo));
// Record mregparm value now so it is visible through rest of codegen.
if (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86)
getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters",
CodeGenOpts.NumRegisterParameters);
}
CodeGenModule::~CodeGenModule() {}
......@@ -416,6 +422,7 @@ void CodeGenModule::Release() {
(Context.getLangOpts().Modules || !LinkerOptionsMetadata.empty())) {
EmitModuleLinkOptions();
}
if (CodeGenOpts.DwarfVersion) {
// We actually want the latest version when there are conflicts.
// We can change from Warning to Latest if such mode is supported.
......
// RUN: %clang_cc1 %s -triple i386-unknown-linux-gnu -mregparm 3 -emit-llvm -o - | FileCheck %s
void *memcpy(void *dest, const void *src, unsigned int n);
void use_builtin_memcpy(void *dest, const void *src, unsigned int n) {
__builtin_memcpy(dest, src, n);
}
void use_memcpy(void *dest, const void *src, unsigned int n) {
memcpy(dest, src, n);
}
//CHECK: !{i32 1, !"NumRegisterParameters", i32 3}
......@@ -9,4 +9,4 @@
// CHECK: target triple = "powerpc64-
// CHECK-NEXT: {{^$}}
// CHECK-NEXT: llvm.ident
// CHECK-NEXT: {{llvm\..*}}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment