From 083eeaf1e9fc4e929b8f805deb4d3d3d0be038fc Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Fri, 6 Sep 2013 15:34:50 -0700 Subject: PNaCl bitcode: Use function type not ptr-to-function type to declare function This is a step towards removing TYPE_CODE_POINTER from the types table. This will make the format simpler. It will also make bitcode files a little smaller, because we won't need to use type IDs for referring to pointer types. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3671 TEST=test/NaCl/Bitcode/*.ll Review URL: https://codereview.chromium.org/24049002 --- lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp') diff --git a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp index 3355bc757c..6280e5ccfc 100644 --- a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp +++ b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp @@ -418,7 +418,10 @@ static void WriteModuleInfo(const Module *M, const NaClValueEnumerator &VE, SmallVector Vals; for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) { // FUNCTION: [type, callingconv, isproto, linkage] - Vals.push_back(VE.getTypeID(F->getType())); + Type *Ty = F->getType(); + if (PNaClVersion >= 2) + Ty = Ty->getPointerElementType(); + Vals.push_back(VE.getTypeID(Ty)); Vals.push_back(GetEncodedCallingConv(F->getCallingConv())); Vals.push_back(F->isDeclaration()); Vals.push_back(getEncodedLinkage(F)); -- cgit v1.2.3-18-g5258