Skip to content
Snippets Groups Projects
  1. Apr 28, 2015
  2. Apr 23, 2015
  3. Mar 04, 2015
  4. Dec 10, 2014
    • Sean Callanan's avatar
      Modified the Objective-C lexer and parser (only · fd797b80
      Sean Callanan authored
      in debugger mode) to accept @import declarations
      and pass them to the debugger.  
      
      In the preprocessor, accept import declarations
      if the debugger is enabled, but don't actually
      load the module, just pass the import path on to 
      the preprocessor callbacks.
      
      In the Objective-C parser, if it sees an import
      declaration in statement context (usual for LLDB),
      ignore it and return a NullStmt.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223855 91177308-0d34-0410-b5e6-96231b3b80d8
      fd797b80
  5. Dec 02, 2014
  6. Oct 18, 2014
  7. Sep 15, 2014
  8. Sep 12, 2014
  9. Sep 10, 2014
  10. Aug 29, 2014
  11. Aug 27, 2014
    • David Blaikie's avatar
      Overload SourceManager::overrideFileContents so that unconditionally passing... · 926a507e
      David Blaikie authored
      Overload SourceManager::overrideFileContents so that unconditionally passing ownership is explicitly done using unique_ptr.
      
      Only those callers who are dynamically passing ownership should need the
      3 argument form. Those accepting the default ("do pass ownership")
      should do so explicitly with a unique_ptr now.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216614 91177308-0d34-0410-b5e6-96231b3b80d8
      926a507e
    • Rafael Espindola's avatar
      Update for LLVM api change. · d92e74d9
      Rafael Espindola authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216585 91177308-0d34-0410-b5e6-96231b3b80d8
      d92e74d9
    • Ted Kremenek's avatar
      Add support for the static analyzer to synthesize function implementations... · fdf0d351
      Ted Kremenek authored
      Add support for the static analyzer to synthesize function implementations from external model files.
      
      Currently the analyzer lazily models some functions using 'BodyFarm',
      which constructs a fake function implementation that the analyzer
      can simulate that approximates the semantics of the function when
      it is called.  BodyFarm does this by constructing the AST for
      such definitions on-the-fly.  One strength of BodyFarm
      is that all symbols and types referenced by synthesized function
      bodies are contextual adapted to the containing translation unit.
      The downside is that these ASTs are hardcoded in Clang's own
      source code.
      
      A more scalable model is to allow these models to be defined as source
      code in separate "model" files and have the analyzer use those
      definitions lazily when a function body is needed.  Among other things,
      it will allow more customization of the analyzer for specific APIs
      and platforms.
      
      This patch provides the initial infrastructure for this feature.
      It extends BodyFarm to use an abstract API 'CodeInjector' that can be
      used to synthesize function bodies.  That 'CodeInjector' is
      implemented using a new 'ModelInjector' in libFrontend, which lazily
      parses a model file and injects the ASTs into the current translation
      unit.  
      
      Models are currently found by specifying a 'model-path' as an
      analyzer option; if no path is specified the CodeInjector is not
      used, thus defaulting to the current behavior in the analyzer.
      
      Models currently contain a single function definition, and can
      be found by finding the file <function name>.model.  This is an
      initial starting point for something more rich, but it bootstraps
      this feature for future evolution.
      
      This patch was contributed by Gábor Horváth as part of his
      Google Summer of Code project.
      
      Some notes:
      
      - This introduces the notion of a "model file" into
        FrontendAction and the Preprocessor.  This nomenclature
        is specific to the static analyzer, but possibly could be
        generalized.  Essentially these are sources pulled in
        exogenously from the principal translation.
      
        Preprocessor gets a 'InitializeForModelFile' and
        'FinalizeForModelFile' which could possibly be hoisted out
        of Preprocessor if Preprocessor exposed a new API to
        change the PragmaHandlers and some other internal pieces.  This
        can be revisited.
      
        FrontendAction gets a 'isModelParsingAction()' predicate function
        used to allow a new FrontendAction to recycle the Preprocessor
        and ASTContext.  This name could probably be made something
        more general (i.e., not tied to 'model files') at the expense
        of losing the intent of why it exists.  This can be revisited.
      
      - This is a moderate sized patch; it has gone through some amount of
        offline code review.  Most of the changes to the non-analyzer
        parts are fairly small, and would make little sense without
        the analyzer changes.
      
      - Most of the analyzer changes are plumbing, with the interesting
        behavior being introduced by ModelInjector.cpp and
        ModelConsumer.cpp.
      
      - The new functionality introduced by this change is off-by-default.
        It requires an analyzer config option to enable.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216550 91177308-0d34-0410-b5e6-96231b3b80d8
      fdf0d351
  12. Aug 11, 2014
  13. Jul 24, 2014
  14. Jun 26, 2014
  15. Jun 09, 2014
  16. May 18, 2014
  17. May 17, 2014
  18. May 16, 2014
  19. May 09, 2014
    • Nico Weber's avatar
      Don't leak MacroArgs when using code completion, PR19688. · 3ae09ee2
      Nico Weber authored
      MacroArgs are owned by TokenLexer, and when a TokenLexer is destroyed, it'll
      call its MacroArgs's destroy() method.  destroy() only appends the MacroArg to
      Preprocessor's MacroArgCache list, and Preprocessor's destructor then calls
      deallocate() on all MacroArgs in that list.  This method then ends up freeing
      the MacroArgs's memory.
      
      In a code completion context, Parser::cutOffParsing() gets called when a code
      completion token is hit, which changes the type of the current token to
      tok::eof.  eof tokens aren't always ConsumeToken()ed, so
      Preprocessor::HandleEndOfFile() isn't always called, and that function is
      responsible for popping the macro stack.
      
      Due to this, Preprocessor::CurTokenLexer can be non-NULL when
      ~Preprocessor runs.  It's a unique_ptr, so it ended up being destructed after
      ~Preprocessor completed, and its MacroArgs thus got added to the freelist after
      the code freeing things on the freelist had already completed.  The fix is to
      explicitly call reset() before the freelist processing happens.  (See the bug
      for more notes.)
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208438 91177308-0d34-0410-b5e6-96231b3b80d8
      3ae09ee2
  20. May 02, 2014
  21. Mar 15, 2014
  22. Mar 07, 2014
  23. Feb 24, 2014
  24. Feb 17, 2014
  25. Feb 13, 2014
  26. Jan 31, 2014
  27. Jan 07, 2014
  28. Nov 23, 2013
  29. Nov 07, 2013
  30. Sep 19, 2013
    • Eli Friedman's avatar
      Make Preprocessor::Lex non-recursive. · d2f93082
      Eli Friedman authored
      Before this patch, Lex() would recurse whenever the current lexer changed (e.g.
      upon entry into a macro). This patch turns the recursion into a loop: the
      various lex routines now don't return a token when the current lexer changes,
      and at the top level Preprocessor::Lex() now loops until it finds a token.
      Normally, the recursion wouldn't end up being very deep, but the recursion depth
      can explode in edge cases like a bunch of consecutive macros which expand to
      nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this
      patch).
      
      <rdar://problem/14569770>
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190980 91177308-0d34-0410-b5e6-96231b3b80d8
      d2f93082
  31. Aug 05, 2013
  32. May 04, 2013
Loading