This change is separated from https://reviews.llvm.org/D68578
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
1025–1026 | What would be necessary in order for this to turn into just mangleName(GD, Out)? I suspect there are a lot of subtle assumptions between the different mangling methods today that could probably be broken down a bit and we'd end up with something much cleaner. |
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
1025–1026 | It seems to be just API changes. I will try changing them. |
clang/lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
1025–1026 | I got one issue. When I tried to create GlobalDecl(CD, Ctor_DefaultClosure) I got assertion include/llvm/ADT/PointerIntPair.h:186: static intptr_t llvm::PointerIntPairInfo<const clang::Decl *, 2, llvm::PointerLikeTypeTraits<const clang::Decl *> >::updateInt(intptr_t, intptr_t) [PointerT = const clang::Decl *, IntBits = 2, PtrTraits = llvm::PointerLikeTypeTraits<const clang::Decl *>]: Assertion `(IntWord & ~IntMask) == 0 && "Integer too large for field"' failed. This is because Ctor_DefaultClosure has value 4, which exceeds the value that can be put into PointerIntPairInfo |
clang/lib/AST/Expr.cpp | ||
---|---|---|
659–660 | This will need an extension for your case, right? Maybe there should be comments in GlobalDecl pointing out all the places where we need to go from an arbitrary Decl* to a GlobalDecl so that someone adding a new kind of discriminated declaration will know to update them all. | |
clang/lib/AST/ItaniumMangle.cpp | ||
1563 | cast? But I'm not sure this is true, local entities can be in non-function declarations: blocks, ObjC methods, and captured statements. You can just cast<Decl>(DC). | |
clang/lib/CodeGen/CodeGenModule.cpp | ||
1025–1026 | It looks like Decl is declared with alignment 8, so yeah, it's safe to make that a 3-bit field. |
clang/lib/AST/ItaniumMangle.cpp | ||
---|---|---|
1563 | I guess we just never enter this for local names within ObjC methods or blocks? |
clang/lib/AST/Expr.cpp | ||
---|---|---|
659–660 | Added extension for kernel reference here and other places in the other patch. Also added comments to GlobalDecl. | |
clang/lib/AST/ItaniumMangle.cpp | ||
1563 | Original code is cast<FunctionDecl>(DC) since ObjCMethodDecl and BlockDecl are handled separately. Since we dot have GlobalDecl ctor for Decl*, I will cast to FunctionDecl. | |
1563 | Yes. |
This will need an extension for your case, right? Maybe there should be comments in GlobalDecl pointing out all the places where we need to go from an arbitrary Decl* to a GlobalDecl so that someone adding a new kind of discriminated declaration will know to update them all.