[all-commits] [llvm/llvm-project] f3efd6: [ObjC] Make sure that the implicit arguments for d...

Alex Lorenz via All-commits all-commits at lists.llvm.org
Fri Dec 6 14:28:43 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f3efd6957474bfd3b9b232ac6e4b3608174c3b79
      https://github.com/llvm/llvm-project/commit/f3efd6957474bfd3b9b232ac6e4b3608174c3b79
  Author: Alex Lorenz <arphaman at gmail.com>
  Date:   2019-12-06 (Fri, 06 Dec 2019)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGObjCMac.cpp
    M clang/lib/Sema/SemaDeclObjC.cpp
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M clang/lib/Serialization/ASTWriterDecl.cpp
    M clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
    M clang/test/CodeGenObjC/direct-method.m

  Log Message:
  -----------
  [ObjC] Make sure that the implicit arguments for direct methods have been setup

This commit sets the Self and Imp declarations for ObjC method declarations,
in addition to the definitions. It also fixes
a bunch of code in clang that had wrong assumptions about when getSelfDecl() would be set:

- CGDebugInfo::getObjCMethodName and AnalysisConsumer::getFunctionName would assume that it was
  set for method declarations part of a protocol, which they never were,
  and that self would be a Class type, which it isn't as it is id for a protocol.

Also use the Canonical Decl to index the set of Direct methods so that
when calls and implementations interleave, the same llvm::Function is
used and the same symbol name emitted.

Radar-Id: rdar://problem/57661767

Patch by: Pierre Habouzit

Differential Revision: https://reviews.llvm.org/D71091




More information about the All-commits mailing list