Skip to content
  1. Mar 24, 2011
  2. Mar 23, 2011
    • David Chisnall's avatar
      Fixed type error in last commit (forgot that now that selectors are not · 76803410
      David Chisnall authored
      accessed via the indirect pointer, they don't need to be pointers to pointers).
      
      Finished moving the message lookup code into separate subclasses for each
      runtime.  Also performed a few smallish related tidies.
      
      We're now bitcasting the result of the message lookup functions, rather than
      casting the lookup functions themselves, so the messages.m test needed updating
      to reflect this.
      
      llvm-svn: 128180
      76803410
    • Ted Kremenek's avatar
      Fix CFG-construction bug when run from AnalysisBasedWarnings::IssueWarnings()... · dcc4c389
      Ted Kremenek authored
      Fix CFG-construction bug when run from AnalysisBasedWarnings::IssueWarnings() where block-level expressions that need
      to be recorded in the Stmt*->CFGBlock* map were not always done so.  Fixes <rdar://problem/9171946>.
      
      llvm-svn: 128170
      dcc4c389
    • Douglas Gregor's avatar
      Unbreak test · 336a15e0
      Douglas Gregor authored
      llvm-svn: 128168
      336a15e0
    • Fariborz Jahanian's avatar
      Support for Transparent unions used as overloadable · 16f92ce5
      Fariborz Jahanian authored
      function parameter. // rdar:// 9129552
      and PR9406.
      
      llvm-svn: 128159
      16f92ce5
    • Marshall Clow's avatar
      Add a test for !ptr-to-member (should fail) · e7deac8c
      Marshall Clow authored
      llvm-svn: 128158
      e7deac8c
    • Andrew Trick's avatar
      4a3ee934
    • David Chisnall's avatar
      Remove the redundant loads / stores to globals that we were generating for... · f1a38cf3
      David Chisnall authored
      Remove the redundant loads / stores to globals that we were generating for selectors (GNU runtimes).
      
      llvm-svn: 128156
      f1a38cf3
    • David Chisnall's avatar
      Initial work on refactoring GNU runtime code (long overdue - it's quite obvious · d7972f5b
      David Chisnall authored
      that I hadn't used C++ for several years before writing most of this code).
      Still lots more to do.  This set of changes includes:
      
      - Remove the distinction between typed and untyped selectors.  More accurately
        reflect what the runtime does, by using typed selectors everywhere, with an
        empty type field if the types are unknown.  Now we just store a small list of
        types for each selector (in theory, this should always be exactly one, but
        this constraint was not enforced back in 1986 when it should have been).
      
      - Add some consistency to how runtime functions are created.  These are all
        generated via the LazyRuntimeFunction class (which might be useful outside
        CGObjCGNU - feel free to move it into a header if it is).  This function
        stores the types of a function, looks it up the first time it's used, and
        caches the result.  This means that we're now not wasting time constructing
        the llvm::FunctionType every time some of the functions are looked up, but
        also not inserting references to runtime functions into the module if they're
        not actually used.
      
      - Started separating out the fragile and non-fragile ABI behaviours into two
        subclasses of CGObjCGNU: CGObjCGCC for the legacy GCC runtime ABI and
        CGObjCGNUstep for the new GNUstep ABI.  Not all of the differences in
        behaviour are factored out yet, but they will be in future commits.
      
      - Removed all of the CodeGen:: things: we've been using namespace CodeGen in
        this file for ages, so having explicit namespace specifiers is just a bit
        confusing.
      
      - Added a few more comments.
      
      - Used llvm::StringRef instead of std::string in a few places.
      
      - Finally got around to storing the module path in the module structure.  The
        ABI says that the compiler should do this, although it's not used in the
        runtime or exposed outside the runtime, so it's pretty useless.  
      
      Still to do:
      
      - We currently have two code paths for generating try blocks, one for ObjC and
        one for ObjC++.  Not only are these substantially similar, they are also very
        similar to the CGObjCMac version.  These need factoring out into a single
        parameterised implementation, either in CGObjCRuntime or CodeGenFunction.
        The EmitObjCXXTryStmt() function was added so that the changes to fix a bug
        in time for the 2.9 release would be self-contained and reduce the chances of
        breaking anything else, but these should be done properly as soon as
        possible.
      
      - Split up some large functions (e.g. GenerateClass()) into smaller functions
        for generating the various data structures.
      
      - The method lookup code into the two subclasses, removing the conditionals in
        the message send functions.
      
      - Add doxygen comments on the remaining undocumented functions.
      
      - We seem to be generating global pointer variables for selectors, then storing
        a pointer to the selector, then generating a load of this pointer (and then a
        load of the real selector later) every time a static selector is used.  I can
        only assume I was asleep or drunk when I did this - we should just be
        referencing the selectors directly in the selector array.
      
      llvm-svn: 128152
      d7972f5b
    • Devang Patel's avatar
      Update type cache when a type is completed. · 945b8aed
      Devang Patel authored
      Radar 9168773
      
      llvm-svn: 128150
      945b8aed
    • Douglas Gregor's avatar
      Teach DelayedDiagnostic to copy its string, rather than hope that the · 899b68fd
      Douglas Gregor authored
      string itself lives longer than the DelayedDiagnostic. Fixes a recent
      use-after-free regression due to my availability attribute work. 
      
      llvm-svn: 128148
      899b68fd
    • Douglas Gregor's avatar
      Ignore weak_import on Objective-C property and method declarations on · d71149a4
      Douglas Gregor authored
      all platforms, not just darwin. Fixes the regression in this test case.
      
      llvm-svn: 128147
      d71149a4
    • Chris Lattner's avatar
      switch a few Driver APIs to use llvm::ArrayRef, cleaning up code. · ce6c42f6
      Chris Lattner authored
      llvm-svn: 128142
      ce6c42f6
    • Chris Lattner's avatar
      remove a dead variable. · 89d3b337
      Chris Lattner authored
      llvm-svn: 128141
      89d3b337
    • Ted Kremenek's avatar
      Fix crash in clang_getInstantiationLoc() when... · 1ba9bbc1
      Ted Kremenek authored
      Fix crash in clang_getInstantiationLoc() when SourceManager::getInstantiationLoc() can return a SourceLocatin with an invalid
      FileID on invalid code.  Fixes <rdar://problem/9164623>.
      
      llvm-svn: 128139
      1ba9bbc1
    • Ted Kremenek's avatar
      std::vector::data() is not portable to VS. Use a gross hack instead. · d6f4ad15
      Ted Kremenek authored
      llvm-svn: 128138
      d6f4ad15
    • Ken Dyck's avatar
      Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) to · 3fb4c892
      Ken Dyck authored
      CharUnits. No change in functionality intended.
      
      llvm-svn: 128129
      3fb4c892
    • Douglas Gregor's avatar
      Implement a new 'availability' attribute, that allows one to specify · 20b2ebd7
      Douglas Gregor authored
      which versions of an OS provide a certain facility. For example,
      
        void foo()
        __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));
      
      says that the function "foo" was introduced in 10.2, deprecated in
      10.4, and completely obsoleted in 10.6. This attribute ties in with
      the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
      we want to deploy back to Mac OS X 10.1). There are several concrete
      behaviors that this attribute enables, as illustrated with the
      function foo() above:
      
        - If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
          will result in a deprecation warning, as if we had placed
          attribute((deprecated)) on it (but with a better diagnostic)
        - If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
          will result in an "unavailable" warning (in C)/error (in C++), as
          if we had placed attribute((unavailable)) on it
        - If we choose a deployment target prior to 10.2, foo() is
          weak-imported (if it is a kind of entity that can be weak
          imported), as if we had placed the weak_import attribute on it.
      
      Naturally, there can be multiple availability attributes on a
      declaration, for different platforms; only the current platform
      matters when checking availability attributes.
      
      The only platforms this attribute currently works for are "ios" and
      "macosx", since we already have -mxxxx-version-min flags for them and we
      have experience there with macro tricks translating down to the
      deprecated/unavailable/weak_import attributes. The end goal is to open
      this up to other platforms, and even extension to other "platforms"
      that are really libraries (say, through a #pragma clang
      define_system), but that hasn't yet been designed and we may want to
      shake out more issues with this narrower problem first.
      
      Addresses <rdar://problem/6690412>.
      
      As a drive-by bug-fix, if an entity is both deprecated and
      unavailable, we only emit the "unavailable" diagnostic.
      
      llvm-svn: 128127
      20b2ebd7
    • Ken Dyck's avatar
      Convert NonVirtual parameter of ApplyNonVirtualAndVirtualOffset() to · cfc332cc
      Ken Dyck authored
      CharUnits. No change in functionality intended.
      
      llvm-svn: 128126
      cfc332cc
    • John McCall's avatar
      Fix an error with the declaration of block parameters that depend · 92d627e1
      John McCall authored
      on previous block parameters that crept in as part of my captures
      work a month or so ago.
      
      llvm-svn: 128121
      92d627e1
    • John McCall's avatar
      Warn about unused declaration-specifiers on tag declarations. · aa017377
      John McCall authored
      llvm-svn: 128118
      aa017377
  3. Mar 22, 2011
Loading