Commit Graph

5 Commits

Author SHA1 Message Date
Evgeny Mankov 9fcb48e5c4 [HIPIFY] Add DEBUG(X) macro compatibility
In LLVM 7.0 DEBUG(X) was deleted, LLVM_DEBUG(X) should be used instead.
2018-07-11 18:21:00 +03:00
Evgeny Mankov 8499e79e2b [HIPIFY] undo apply .clangformat to HIPIFY source files 2018-04-23 20:22:15 +03:00
Maneesh Gupta 1ba06f63c4 Apply .clangformat to all repo source files
Change-Id: I7e79c6058f0303f9a98911e3b7dd2e8596079344
2018-03-12 11:29:03 +05:30
Evgeny Mankov 7f3e89bbb0 [HIPIFY][fix] Build against llvm 3.8.0 fixed - missing include
/srv/HIP/hipify-clang/src/main.cpp:134:19: error: no member named 'dbgs' in namespace 'llvm'
      DEBUG(llvm::dbgs() << "Skipped some replacements.\n");
            ~~~~~~^
2018-02-08 00:08:47 +03:00
Chris Kitching 24cdc5e1d3 Use a custom FrontendAction to simplify identifier translation
Most of what hipify does is really just replacing CUDA idenitifers
with HIP ones. CUDA function calls, preprocessor macro calls,
enum references, types, etc.

This is problematic: calls/types/enum-refs require name resolution
for the AST matcher to work. This fails in the presence of code
deleted by the preprocessor, and in two-pass template compilation.

Instead, we can simply hook the lexer and have it rewrite the
identifiers for us.

This approach means identifier transformations will work correctly
regardless of where they appear (and we get to delete lots of code)

- Fixes #260
- Helps a bit with #207 - it will still fail to translate kernel
calls in preprocessor-ignored code, but everything except kerel
launches should translate correctly now, even in
preprocessor-deleted code.
2017-11-13 20:58:54 +00:00