diff --git a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp --- a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp +++ b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp @@ -1551,14 +1551,17 @@ FOREVERY_SIMPLEX_V(IMPL_ADDELT) IMPL_ADDELT(C64, complex64) // Marked static because it's not part of the public API. -// (The `static` keyword confuses clang-format, so the extraneous trailing -// semicolon is required to teach clang-format not to indent the prototype -// of `_mlir_ciface_addEltC32` below.) -static IMPL_ADDELT(C32ABI, complex32); +// NOTE: the `static` keyword confuses clang-format here, causing +// the strange indentation of the `_mlir_ciface_addEltC32` prototype. +// In C++11 we can add a semicolon after the call to `IMPL_ADDELT` +// and that will correct clang-format. Alas, this file is compiled +// in C++98 mode where that semicolon is illegal (and there's no portable +// macro magic to license a no-op semicolon at the top level). +static IMPL_ADDELT(C32ABI, complex32) #undef IMPL_ADDELT -void *_mlir_ciface_addEltC32(void *coo, float r, float i, - StridedMemRefType *iref, - StridedMemRefType *pref) { + void *_mlir_ciface_addEltC32(void *coo, float r, float i, + StridedMemRefType *iref, + StridedMemRefType *pref) { return _mlir_ciface_addEltC32ABI(coo, complex32(r, i), iref, pref); } @@ -1595,14 +1598,12 @@ FOREVERY_SIMPLEX_V(IMPL_LEXINSERT) IMPL_LEXINSERT(C64, complex64) // Marked static because it's not part of the public API. -// (The `static` keyword confuses clang-format, so the extraneous trailing -// semicolon is required to teach clang-format not to indent the prototype -// of `_mlir_ciface_lexInsertC32` below.) -static IMPL_LEXINSERT(C32ABI, complex32); +// NOTE: see the note for `_mlir_ciface_addEltC32ABI` +static IMPL_LEXINSERT(C32ABI, complex32) #undef IMPL_LEXINSERT -void _mlir_ciface_lexInsertC32(void *tensor, - StridedMemRefType *cref, float r, - float i) { + void _mlir_ciface_lexInsertC32(void *tensor, + StridedMemRefType *cref, + float r, float i) { _mlir_ciface_lexInsertC32ABI(tensor, cref, complex32(r, i)); }