1. 28 Aug, 2014 1 commit
  2. 04 Jun, 2014 1 commit
  3. 03 Jun, 2014 1 commit
  4. 23 May, 2014 2 commits
  5. 15 May, 2014 2 commits
  6. 05 Mar, 2014 1 commit
  7. 27 Feb, 2014 3 commits
  8. 24 Feb, 2014 3 commits
  9. 08 Jan, 2014 1 commit
  10. 03 Dec, 2013 1 commit
  11. 29 Nov, 2013 2 commits
  12. 28 Nov, 2013 1 commit
  13. 10 Oct, 2013 1 commit
  14. 12 Sep, 2013 1 commit
  15. 17 Jul, 2013 1 commit
  16. 11 Jun, 2013 1 commit
    • Erik Verbruggen's avatar
      C++: Fix preprocessor blocked macro bug. · 271c3f45
      Erik Verbruggen authored
      
      
      By lexing the first token after a macro call (meaning: the token after
      the closing parenthesis (which was passed to handleFunctionLikeMacro
      which in turn pushed it back into the token buffer)), a token buffer
      might be popped, which unblocks the macro that generated the actual
      param pack. The effect was that if this happens in the expansion of a
      recursive macro (with parameters!), the preprocessor ended up in an
      infinite loop.
      
      Task-number: QTCREATORBUG-9015
      Task-number: QTCREATORBUG-9447
      
      Change-Id: I0d83c59188ec15c4a948970e9fa944a17d765475
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      271c3f45
  17. 03 Jun, 2013 1 commit
  18. 30 May, 2013 1 commit
    • Erik Verbruggen's avatar
      C++: do not strip trailing newlines in the preprocessor output. · f2631ad0
      Erik Verbruggen authored
      
      
      Doing so resulted in an incorrect position for the EOF token when the
      preprocessed output would be parsed. That in turn leads to incorrect
      insertion positions for refactoring actions.
      
      This is especially true when a file contains only preprocessor
      directives: the EOF token would point to line 1 column 1, which is
      usually not the place where code should be inserted.
      
      Change-Id: I7d359aa7a6c04bc52c8b873fd49ad6afc3a77319
      Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
      f2631ad0
  19. 29 Apr, 2013 1 commit
    • 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
  20. 19 Apr, 2013 1 commit
  21. 16 Apr, 2013 2 commits
  22. 08 Apr, 2013 1 commit
    • Erik Verbruggen's avatar
      C++: pre-allocate the output buffer. · 2d500117
      Erik Verbruggen authored
      
      
      This prevents a whole lot of re-allocations when the output byte array
      needs to grow. It also prevents some heap fragmentation for big files.
      
      Because the preprocessed output is short lived (it will be parsed
      immediately after, and then discarded), it is not squeezed to the
      minimal size. This would result in another allocation.
      
      Change-Id: I4974be5144f88cdfc4ddc9d8330200725aa90803
      Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
      Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
      2d500117
  23. 03 Apr, 2013 1 commit
  24. 22 Feb, 2013 1 commit
  25. 29 Jan, 2013 1 commit
  26. 18 Jan, 2013 2 commits
    • 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
  27. 11 Jan, 2013 2 commits
  28. 08 Jan, 2013 1 commit
    • Orgad Shaneh's avatar
      Remove braces for single lines of conditions · 29a93998
      Orgad Shaneh authored
      
      
      #!/usr/bin/env ruby
      
      Dir.glob('**/*.cpp') { |file|
        # skip ast (excluding paste, astpath, and canv'ast'imer)
        next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
        s = File.read(file)
        next if s.include?('qlalr')
        orig = s.dup
        s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
          res = $&
          if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
            res
          else
            res.gsub!('} else', 'else')
            res.gsub!(/\n +} *\n/m, "\n")
            res.gsub(/ *{$/, '')
          end
        }
        s.gsub!(/ *$/, '')
        File.open(file, 'wb').write(s) if s != orig
      }
      
      Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      29a93998
  29. 20 Dec, 2012 1 commit
  30. 04 Dec, 2012 1 commit