[cfe-commits] r103131 - in /cfe/trunk: lib/CodeGen/CGVTables.cpp test/CodeGenCXX/x86_32-arguments.cpp
Chris Lattner
sabre at nondot.org
Wed May 5 15:55:13 PDT 2010
Author: lattner
Date: Wed May 5 17:55:13 2010
New Revision: 103131
URL: http://llvm.org/viewvc/llvm-project?rev=103131&view=rev
Log:
Pass the globaldecl into GetOrCreateLLVMFunction so that llvm
function attributes like byval get applied to the function
definition. This fixes PR7058 and makes i386 llvm/clang bootstrap
pass all the same tests as x86-64 bootstrap for me (the llvmc
tests still fail in both).
Modified:
cfe/trunk/lib/CodeGen/CGVTables.cpp
cfe/trunk/test/CodeGenCXX/x86_32-arguments.cpp
Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=103131&r1=103130&r2=103131&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Wed May 5 17:55:13 2010
@@ -2548,7 +2548,7 @@
getMangleContext().mangleThunk(MD, Thunk, Name);
const llvm::Type *Ty = getTypes().GetFunctionTypeForVTable(MD);
- return GetOrCreateLLVMFunction(Name, Ty, GlobalDecl());
+ return GetOrCreateLLVMFunction(Name, Ty, GD);
}
static llvm::Value *PerformTypeAdjustment(CodeGenFunction &CGF,
Modified: cfe/trunk/test/CodeGenCXX/x86_32-arguments.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/x86_32-arguments.cpp?rev=103131&r1=103130&r2=103131&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/x86_32-arguments.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/x86_32-arguments.cpp Wed May 5 17:55:13 2010
@@ -3,7 +3,7 @@
// Non-trivial dtors, should both be passed indirectly.
struct S {
~S();
- int s;
+ short s;
};
// CHECK: define void @_Z1fv(%struct.S* sret %
@@ -22,3 +22,32 @@
// CHECK: define void @_Z1f1C(%class.C*)
void f(C) { }
+
+
+
+
+// PR7058 - Missing byval on MI thunk definition.
+
+// CHECK: define void @_ZThn4_N18BasicAliasAnalysis13getModRefInfoE8CallSite
+// ...
+// CHECK: %struct.CallSite* byval %CS)
+struct CallSite {
+ unsigned Ptr;
+ CallSite(unsigned XX) : Ptr(XX) {}
+};
+
+struct AliasAnalysis {
+ virtual void xyz();
+ virtual void getModRefInfo(CallSite CS) = 0;
+};
+
+struct ModulePass {
+ virtual void xx();
+};
+
+struct BasicAliasAnalysis : public ModulePass, public AliasAnalysis {
+ void getModRefInfo(CallSite CS);
+};
+
+void BasicAliasAnalysis::getModRefInfo(CallSite CS) {
+}
More information about the cfe-commits
mailing list