Skip to content
Snippets Groups Projects
  1. May 15, 2013
  2. Apr 29, 2013
    • Francois Ferrand's avatar
      C++: fix handling of empty va_args macro arguments. · 4d18710f
      Francois Ferrand authored
      
      Preprocessor did not correctly handle when variadic macro arguments were not
      provided at all, if there were other arguments: macro was not expanded
      in case only the non variadic arguments were given.
      
       #define MACRO(...)       used to work fine for 0 or more arguments.
       #define MACRO(ARG0, ...) used to work only for 2 or more arguments, now fixed.
      
      Change-Id: I64e9199ceccae05618a49931c2adad8e4f9471ba
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      4d18710f
  3. Apr 09, 2013
  4. Apr 03, 2013
  5. Jan 29, 2013
  6. Jan 18, 2013
    • Erik Verbruggen's avatar
      C++: add include-guard tracking. · dada2614
      Erik Verbruggen authored
      
      Track the typical #ifndef/#define/#endif usage in header files to see if
      the macro is an include guard. If so, store it in the Document. No
      behavioural change, just recording the name.
      
      This can be used in the future to track if a file needs to be re-parsed
      when a macro changes: if it was used in the file, and not defined in it
      nor being the include-guard, a file should be re-preprocessed and
      re-parsed.
      
      It can also be used to check if two files have the same include guard.
      
      Change-Id: I2715f529997a7b24a11bdbc6150652e2669f1a46
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      dada2614
    • Francois Ferrand's avatar
      C++: fix macro calls with comment before arguments · 4c43655c
      Francois Ferrand authored
      
      When in 'keep comments' mode, the preprocessor does not properly handle macro calls with
      comments between the macro name and the opening parenthesis: "FOO /*something to say*/
      (45)".
      
      Change-Id: I6fe733242e4d2ccff2985d17399d0a084917415a
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      4c43655c
  7. Nov 07, 2012
    • Nikolai Kosjar's avatar
      Tests: C++: Make tests run from shadow builds. · 492ca1cb
      Nikolai Kosjar authored
      
      For shadow builds some tests couldn't find their test data. Solved by
      using the same pattern as in Qt tests: Inject $$PWD as SRCDIR via a
      DEFINES statement.
      
      Note: It was considered to use QFINDTESTDATA for Qt5, but this was
      rejected due to:
       1) It's Qt5 only (would mean to introduce some wrapper...)
       2) As the doc states, it will not work with QTEST_APPLESS_MAIN tests.
      
      Change-Id: Ie6cf59570fe61725b7f6f83b7da650331ddb38fc
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      492ca1cb
  8. Oct 05, 2012
  9. Sep 05, 2012
  10. Aug 29, 2012
  11. Aug 23, 2012
  12. Aug 07, 2012
  13. Jul 19, 2012
  14. Jun 25, 2012
    • Leandro Melo's avatar
      C++: Core changes in preprocessing · d6ccffc0
      Leandro Melo authored
      
      Summary of most relevant items:
      
      - Preprocessor output format change. No more gen true/false. Instead
        a more intuitive and natural expansion (like from a real compiler) is
        performed directly corresponding to the macro invocation. Notice that
        information about the generated tokens is not lost, because it's now
        embedded in the expansion section header (in terms of lines and columns
        as explained in the code). In addition the location on where the macro
        expansion happens is also documented for future use.
      
      - Fix line control directives and associated token line numbers.
        This was not detected in tests cases because some of them were
        actually wrong: Within expansions the line information was being
        considered as originally computed in the macro definition, while
        the desired and expected for Creator's reporting mechanism (just
        like regular compilers) is the line from the expanded version
        of the tokens.
      
      - Do not allow for eager expansion. This was previously being done
        inside define directives. However, it's not allowed and might
        lead to incorrect results, since the argument substitution should
        only happen upon the macro invocation (and following nested ones).
        At least GCC and clang are consistent with that. See test case
        tst_Preprocessor:dont_eagerly_expand for a detailed explanation.
      
      - Revive the 'expanded' token flag. This is used to mark every token
        that originates from a macro expansion. Notice, however, that
        expanded tokens are not necessarily generated tokens (although
        every generated token is a expanded token). Expanded tokens that
        are not generated are those which are still considered by our
        code model features, since they are visible on the editor. The
        translation unit is smart enough to calculate line/column position
        for such tokens based on the information from the expansion section
        header.
      
      - How expansions are tracked has also changed. Now, we simply add
        two surrounding marker tokens to each "top-level" expansion
        sequence. There is an enumeration that control expansion states.
        Also, no "previous" token is kept around.
      
      - Preprocessor client methods suffered a change in signature so
        they now receive the line number of the action in question as
        a paramater. Previously such line could be retrieved by the client
        implementation by accessing the environment line. However, this
        is not reliable because we try to avoid synchronization of the
        output/environment lines in order to avoid unnecessary output,
        while expanding macros or handling preprocessor directives.
      
      - Although macros are not expanded during define directives (as
        mentioned above) the preprocessor client is now "notified"
        when it sees a macro. This is to allow usage tracking.
      
      - Other small stuff.
      
      This is all in one patch because the fixes are a consequence
      of the change in preprocessing control.
      
      Change-Id: I8f4c6e6366f37756ec65d0a93b79f72a3ac4ed50
      Reviewed-by: default avatarRoberto Raggi <roberto.raggi@nokia.com>
      d6ccffc0
  15. Jun 19, 2012
    • Leandro Melo's avatar
      Revert "C++: Re-enable macro definition line test" · 9daa3400
      Leandro Melo authored
      
      This reverts commit 44d8e7be.
      
      The original test case was actually right. I guess I was mislead
      by the recently added preprocessor tests, which are the ones
      that should be corrected (together with the preprocessor, which
      seems to have issues with # lineno generation).
      
      Conflicts:
      
      	tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp
      
      Change-Id: I47f82ed23a37086d0d81c4b3ea2cac48fb753451
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      Reviewed-by: default avatarFrancois Ferrand <thetypz@gmail.com>
      9daa3400
    • Leandro Melo's avatar
      C++: Better handling of arg count mismatch in macros · f978400a
      Leandro Melo authored
      
      Do not expand function-like macros at all when there's a mismatch
      in the parameter/argument count.
      
      The report below raises the issue but its expected result is not
      correct. This would be the more appropriate fix.
      
      Task-number: QTCREATORBUG-7225
      Change-Id: Ide8580faa7b724d3e8b396ec1f899cc5ca7f9e7e
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      f978400a
  16. Jun 12, 2012
  17. Jun 05, 2012
  18. Jun 01, 2012
    • Leandro Melo's avatar
      C++: Fix macro uses line info · ca7ac8c0
      Leandro Melo authored
      
      Make sure the environment line is consistent during preprocessor
      directives and identifier handling so clients can rely on consistent
      information. Particularly important for macro usages.
      
      New tests also added.
      
      Change-Id: I962a39a86cd17b8d945d2959c2c95e2d258ea3e6
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      ca7ac8c0
  19. May 31, 2012
  20. May 30, 2012
  21. May 15, 2012
  22. Apr 27, 2012
  23. Apr 26, 2012
  24. Apr 25, 2012
  25. Apr 19, 2012
  26. Apr 17, 2012
  27. Apr 02, 2012
  28. Mar 30, 2012
  29. Mar 29, 2012
Loading