From viridia at gmail.com Mon Oct 19 00:12:43 2009 From: viridia at gmail.com (Talin) Date: Sun, 18 Oct 2009 22:12:43 -0700 Subject: [llvm-commits] PATCH: Additional DebugFactory methods In-Reply-To: <7083196B-95FE-4F1D-89AE-2D38B2D0D72F@apple.com> References: <7083196B-95FE-4F1D-89AE-2D38B2D0D72F@apple.com> Message-ID: Here's an updated version of the patch which uses StringRef as requested. Also, I have changed the method names to avoid the ambiguity problems encountered in the last patch. The new methods end with "Ex" which can stand either for "Expression" or "Extension" depending on your preference. :) On Sat, Oct 17, 2009 at 9:32 PM, Chris Lattner wrote: > > On Oct 5, 2009, at 10:48 PM, Talin wrote: > > The attached patch adds some additional convenience methods to >> DebugFactory. Specifically, methods that take a uint64 for size, alignment >> or offset, can now also take a Constant *. This is very useful for >> target-independent frontends which can use things like >> ConstantExpr::getSizeof(). I've been using this for about a week in my own >> code and it seems to work fine, >> > > Hi Talin, > > Sorry for the delay, still getting caught up. Please change this to use > StringRef like the current DebugInfo.h methods do. > > Devang, can you review this in more detail? > > -Chris > > -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20091018/3dbd8077/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: debug_constants.patch Type: application/octet-stream Size: 7759 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20091018/3dbd8077/attachment.obj From sabre at nondot.org Mon Oct 19 00:31:11 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 19 Oct 2009 05:31:11 -0000 Subject: [llvm-commits] [llvm] r84463 - in /llvm/trunk/lib/AsmParser: LLParser.cpp LLToken.h Message-ID: <200910190531.n9J5VBQD029063@zion.cs.uiuc.edu> Author: lattner Date: Mon Oct 19 00:31:10 2009 New Revision: 84463 URL: http://llvm.org/viewvc/llvm-project?rev=84463&view=rev Log: clean up after metadata changes. Modified: llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/AsmParser/LLToken.h Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=84463&r1=84462&r2=84463&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Oct 19 00:31:10 2009 @@ -1051,14 +1051,12 @@ /// ::= /* empty */ /// ::= !dbg !42 bool LLParser::ParseOptionalCustomMetadata() { - - std::string Name; - if (Lex.getKind() == lltok::NamedOrCustomMD) { - Name = Lex.getStrVal(); - Lex.Lex(); - } else + if (Lex.getKind() != lltok::NamedOrCustomMD) return false; + std::string Name = Lex.getStrVal(); + Lex.Lex(); + if (Lex.getKind() != lltok::Metadata) return TokError("Expected '!' here"); Lex.Lex(); @@ -2880,8 +2878,6 @@ if (ParseType(Ty, true /*void allowed*/)) return true; if (Ty->isVoidTy()) { - if (EatIfPresent(lltok::comma)) - if (ParseOptionalCustomMetadata()) return true; Inst = ReturnInst::Create(Context); return false; } @@ -2917,8 +2913,6 @@ } } } - if (EatIfPresent(lltok::comma)) - if (ParseOptionalCustomMetadata()) return true; Inst = ReturnInst::Create(Context, RV); return false; Modified: llvm/trunk/lib/AsmParser/LLToken.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=84463&r1=84462&r2=84463&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLToken.h (original) +++ llvm/trunk/lib/AsmParser/LLToken.h Mon Oct 19 00:31:10 2009 @@ -64,7 +64,6 @@ kw_sideeffect, kw_msasm, kw_gc, - kw_dbg, kw_c, kw_cc, kw_ccc, kw_fastcc, kw_coldcc, From sabre at nondot.org Mon Oct 19 00:34:14 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 19 Oct 2009 05:34:14 -0000 Subject: [llvm-commits] [llvm] r84464 - in /llvm/trunk/test/Feature: md_on_instruction.ll md_on_instruction2.ll Message-ID: <200910190534.n9J5YE8Q029161@zion.cs.uiuc.edu> Author: lattner Date: Mon Oct 19 00:34:14 2009 New Revision: 84464 URL: http://llvm.org/viewvc/llvm-project?rev=84464&view=rev Log: eliminate md_on_instruction.ll, md_on_instruction2.ll is a superset of it. Added: llvm/trunk/test/Feature/md_on_instruction.ll - copied unchanged from r84459, llvm/trunk/test/Feature/md_on_instruction2.ll Removed: llvm/trunk/test/Feature/md_on_instruction2.ll Removed: llvm/trunk/test/Feature/md_on_instruction2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/md_on_instruction2.ll?rev=84463&view=auto ============================================================================== --- llvm/trunk/test/Feature/md_on_instruction2.ll (original) +++ llvm/trunk/test/Feature/md_on_instruction2.ll (removed) @@ -1,22 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | grep " !dbg " | count 4 -define i32 @foo() nounwind ssp { -entry: - %retval = alloca i32 ; [#uses=2] - call void @llvm.dbg.func.start(metadata !0) - store i32 42, i32* %retval, !dbg !3 - br label %0, !dbg !3 - -;