Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down Expand Up @@ -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.
Expand Down
Empty file modified lib/Driver/ToolChains.cpp
100755 → 100644
Empty file.
Empty file modified lib/Driver/ToolChains.h
100755 → 100644
Empty file.
Empty file modified lib/Driver/Tools.h
100755 → 100644
Empty file.
Empty file modified lib/Driver/Types.cpp
100755 → 100644
Empty file.
13 changes: 13 additions & 0 deletions test/CodeGen/pr3997.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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}
2 changes: 1 addition & 1 deletion test/Headers/altivec-header.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

// CHECK: target triple = "powerpc64-
// CHECK-NEXT: {{^$}}
// CHECK-NEXT: llvm.ident
// CHECK-NEXT: {{llvm\..*}}