From 9b20d841c9ea7303ba891922717589dcc7628bf8 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Wed, 8 Jan 2025 18:35:25 +0900 Subject: [PATCH] Apply clang-format --- cc/include/TableGen.h | 2 +- cc/lib/RecordVal.cpp | 6 +++--- cc/lib/TableGen.cpp | 2 +- cc/lib/Utility.cpp | 11 +++++++---- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cc/include/TableGen.h b/cc/include/TableGen.h index d407824..bac15df 100644 --- a/cc/include/TableGen.h +++ b/cc/include/TableGen.h @@ -56,7 +56,7 @@ void tableGenFree(TableGenParserRef tg_ref); TableGenBool tableGenAddSource(TableGenParserRef tg_ref, const char *source); void tableGenAddSourceFile(TableGenParserRef tg_ref, TableGenStringRef source); void tableGenAddIncludeDirectory(TableGenParserRef tg_ref, - TableGenStringRef include); + TableGenStringRef include); /// NOTE: TableGen currently relies on global state within a given parser /// invocation, so this function is not thread-safe. diff --git a/cc/lib/RecordVal.cpp b/cc/lib/RecordVal.cpp index 8f7ebd2..6aad730 100644 --- a/cc/lib/RecordVal.cpp +++ b/cc/lib/RecordVal.cpp @@ -14,7 +14,7 @@ TableGenStringRef tableGenRecordValGetName(TableGenRecordValRef rv_ref) { auto s = unwrap(rv_ref)->getName(); - return TableGenStringRef { .data = s.data(), .len = s.size() }; + return TableGenStringRef{.data = s.data(), .len = s.size()}; } TableGenTypedInitRef tableGenRecordValGetNameInit(TableGenRecordValRef rv_ref) { @@ -58,8 +58,8 @@ tableGenRecordValGetValAsDefRecord(TableGenRecordValRef rv_ref) { wrap(dyn_cast(unwrap(rv_ref)->getValue()))); } -void tableGenRecordValPrint(TableGenRecordValRef rv_ref, TableGenStringCallback callback, - void *userData) { +void tableGenRecordValPrint(TableGenRecordValRef rv_ref, + TableGenStringCallback callback, void *userData) { ctablegen::CallbackOstream stream(callback, userData); stream << *unwrap(rv_ref); } diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index 7d6308d..537aa1d 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -70,7 +70,7 @@ TableGenBool tableGenAddSource(TableGenParserRef tg_ref, const char *source) { } void tableGenAddIncludeDirectory(TableGenParserRef tg_ref, - TableGenStringRef include) { + TableGenStringRef include) { return unwrap(tg_ref)->addIncludeDirectory( StringRef(include.data, include.len)); } diff --git a/cc/lib/Utility.cpp b/cc/lib/Utility.cpp index 2cb5945..cea99cc 100644 --- a/cc/lib/Utility.cpp +++ b/cc/lib/Utility.cpp @@ -151,9 +151,11 @@ void tableGenInitPrint(TableGenTypedInitRef ti, TableGenStringCallback callback, void tableGenInitDump(TableGenTypedInitRef ti) { unwrap(ti)->dump(); } -TableGenBool tableGenPrintError(TableGenParserRef ref, TableGenSourceLocationRef loc_ref, TableGenDiagKind dk, - TableGenStringRef message, - TableGenStringCallback callback, void *userData) { +TableGenBool tableGenPrintError(TableGenParserRef ref, + TableGenSourceLocationRef loc_ref, + TableGenDiagKind dk, TableGenStringRef message, + TableGenStringCallback callback, + void *userData) { ctablegen::CallbackOstream stream(callback, userData); ArrayRef Loc = *unwrap(loc_ref); @@ -182,7 +184,8 @@ TableGenSourceLocationRef tableGenSourceLocationNull() { return wrap(new ArrayRef(SMLoc())); } -TableGenSourceLocationRef tableGenSourceLocationClone(TableGenSourceLocationRef loc_ref) { +TableGenSourceLocationRef +tableGenSourceLocationClone(TableGenSourceLocationRef loc_ref) { return wrap(new ArrayRef(*unwrap(loc_ref))); }