Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__label__ not supported #3801

Closed
nunoplopes opened this issue Jan 28, 2009 · 29 comments
Closed

__label__ not supported #3801

nunoplopes opened this issue Jan 28, 2009 · 29 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@nunoplopes
Copy link
Member

Bugzilla Link 3429
Resolution FIXED
Resolved on Feb 17, 2011 22:11
Version unspecified
OS All
Blocks llvm/llvm-bugzilla-archive#4068 llvm/llvm-bugzilla-archive#6815 llvm/llvm-bugzilla-archive#3696 llvm/llvm-bugzilla-archive#4151 llvm/llvm-bugzilla-archive#4220
CC @kjwinchester,@tkremenek,@pwo

Extended Description

the following doesnt work (-fsyntax-only):

void foo() {
label l;
int v;
}

@lattner
Copy link
Collaborator

lattner commented Jan 28, 2009

Don't forget fun stuff like:

void foo() {
{
label l;
l: goto l;
}
{
label l;
l: goto l;
}
}

label completely changes the scoping rules for labels :(

@nunoplopes
Copy link
Member Author

*** Bug llvm/llvm-bugzilla-archive#3458 has been marked as a duplicate of this bug. ***

@lattner
Copy link
Collaborator

lattner commented Feb 12, 2009

*** Bug llvm/llvm-bugzilla-archive#3543 has been marked as a duplicate of this bug. ***

@lattner
Copy link
Collaborator

lattner commented Mar 5, 2009

*** Bug llvm/llvm-bugzilla-archive#3737 has been marked as a duplicate of this bug. ***

@efriedma-quic
Copy link
Collaborator

*** Bug llvm/llvm-bugzilla-archive#4151 has been marked as a duplicate of this bug. ***

@lattner
Copy link
Collaborator

lattner commented Feb 22, 2010

*** Bug llvm/llvm-bugzilla-archive#6377 has been marked as a duplicate of this bug. ***

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 6, 2010

Is there any hope this construct will be supported in the short term? I am asking because the Linux kernel (among others) keeps using label and there is no indication the developers will not continue using it.

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 6, 2010

Our (ReactOS) Structured Exception Handling support lib (PSEH) makes use of it too, which is preventing every core module from compiling right now.

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 9, 2010

A logging library/framework I am about to publish soon depends on this feature.
Right now, I have to add #ifdefs to disable some functionality when being compiled with clang.
I'd be happy to be able to offer all features to users of XCode 4 final when it is released.

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 9, 2010

Also filed this as Bug ID# 8287027 with Apple, maybe others who depend on the feature
want to do so too and reference this id.

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 4, 2010

Our compiler team has a patch to add this GCC feature to clang including a nice AST representation, I'll aim to attach it here over the course of the week as part of our series to build the Linux kernel without modification.

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 26, 2010

(work-in-progress) rework of label support
This patch modifies adds support for label GNU locally scoped labels. It also changes ordinary labels to use the same mechanism of label declarations, which are used to track jumps. Other fixes:

  • Jump diagnostics have greatly improved error recovery.
  • Code completion for gotos and address-of-label expressions.
  • No longer back-patches the AST with fake LabelStmts. This provides a more consistent representation of the source, especially in error recovery.
  • All scope checking FIXMEs and known crashers (including jump-into-statement-expressions and VLA expressions) have been fixed.

The patch isn't quite ready to be landed yet but I thought I'd share this now.

@kjwinchester
Copy link
Mannequin

kjwinchester mannequin commented Nov 27, 2010

I get failed hunks in 7 files trying to apply the attached patch to the current clang SVN codebase. Is there a special branch where I should be applying this patch? Or is the development moving so fast that the patch has become out of date?

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 9, 2010

patch refreshed for svn 121290
I've refreshed the patch for 121290, compiles and passes basic tests. Please
note that I did just hand fix of all the rejects and direct adaptation to
latest code updates (like removing Retain() calls on Stmt) and no code review.

Alp, thanks for your work on this patch and please send updates :)

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 17, 2010

update for 122051
fixed crash in clang analyzer: missing Label case in CFGRecStmtDeclVisitor.h

@tkremenek
Copy link
Contributor

Created an attachment (id=5901) [details]
update for 122051

fixed crash in clang analyzer: missing Label case in CFGRecStmtDeclVisitor.h

Is there a test case for this crash?

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 21, 2010

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 21, 2010

Last interesting log messages:

ANALYZE: arch/x86/kernel/apic/io_apic.c setup_IO_APIC_irq_extra
clang:
/usr/src/packages/BUILD/llvm-2.9svn121697/tools/clang/lib/Analysis/../../include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h:70:
void clang::CFGRecStmtDeclVisitor
::VisitDecl(clang::Decl*) [with ImplClass = ::RegisterDecls]: Assertion `false && "Subtype of ScopedDecl not handled."' failed.

Fixed by this:

--- include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h (revision 122335)
+++ include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h (working copy)
@@ -66,6 +66,7 @@
DISPATCH_CASE(Record) // FIXME: Refine. VisitStructDecl?
DISPATCH_CASE(CXXRecord)
DISPATCH_CASE(Enum)

  •    DISPATCH_CASE(Label)
     default:
       assert(false && "Subtype of ScopedDecl not handled.");
    

    }
    @@ -85,6 +86,7 @@
    DEFAULT_DISPATCH(ObjCMethod)
    DEFAULT_DISPATCH(ObjCProtocol)
    DEFAULT_DISPATCH(ObjCCategory)

  • DEFAULT_DISPATCH(Label)

    void VisitCXXRecordDecl(CXXRecordDecl D) {
    static_cast<ImplClass
    >(this)->VisitRecordDecl(D);

Obviously, the crash is caused by unhandled case due to the out-of-tree
label patch. I did not try to reduce the test case.

@lattner
Copy link
Collaborator

lattner commented Feb 17, 2011

updated patch for mainline
I've updated the patch to mainline. There is a lot of goodness here, but it will require a substantial amount of work to get it in shape for submission. It fails 4 tests, primarily due to unused labels.

@lattner
Copy link
Collaborator

lattner commented Feb 18, 2011

Clang now supports label on mainline, but there is still some work to get llvm/llvm-bugzilla-archive#4151 to be useful. Please file new bugs about label details that that you notice which are wrong, I'd like to claim that this is supported for LLVM 2.9

@nunoplopes
Copy link
Member Author

mentioned in issue llvm/llvm-bugzilla-archive#3458

@lattner
Copy link
Collaborator

lattner commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#3543

@EdSchouten
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#3696

@lattner
Copy link
Collaborator

lattner commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#3737

@edwintorok
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#4068

@efriedma-quic
Copy link
Collaborator

mentioned in issue llvm/llvm-bugzilla-archive#4151

@efriedma-quic
Copy link
Collaborator

mentioned in issue llvm/llvm-bugzilla-archive#4220

@lattner
Copy link
Collaborator

lattner commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#6377

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#6815

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this issue Jan 20, 2022
…fef_the_value

[lldb] Unwrap the type when dereferencing the value
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

7 participants