cleanup RSCoordinate handling and factor out coordinate parser
authorLuke Drummond <luke.drummond@codeplay.com>
Wed, 5 Oct 2016 14:34:52 +0000 (14:34 +0000)
committerLuke Drummond <luke.drummond@codeplay.com>
Wed, 5 Oct 2016 14:34:52 +0000 (14:34 +0000)
commit00f56eebcd83eaf6d1936ece7c4ddfe860aa12d6
tree2c99cf6152ea49c4addf73645b1b5860555591af
parent0670e5a35b6fce093c502318991dd55ba000b225
cleanup RSCoordinate handling and factor out coordinate parser

- This change updates the signature of
`RenderScriptRuntime::PlaceBreakpointOnKernel` to take a default
RSCoordinate pointer of nullptr. We use this as the predicate value for
the breakpoint coordinate rather than trying to fit a sentinel `-1` into
a signed version.

```
- void
- PlaceBreakpointOnKernel(Stream &strm, const char *name, const std::array<int, 3> coords, Error &error,
- lldb::TargetSP target);
```

```
+ bool
+ PlaceBreakpointOnKernel(lldb::TargetSP target, Stream &messages, const char *name,
+ const lldb_renderscript::RSCoordinate *coords = nullptr);
```
The above change makes the API for setting breakpoints on kernels
cleaner as it returns a failure value rather than modify a sentinel in
the caller. The optional arguments are now last and have a default
(falsey) value.

- RSCoordinate objects are now comparable with operator== and have
  zero initializers which should make them easier to work on.
- Added a `FMT_COORD` macro for use in logging format strings which
  should make format strings a little less verbose.

llvm-svn: 283320
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h