Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply clang-format #22

Merged
merged 20 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: cargo fmt --check
- run: clang-format --dry-run -Werror wrapper.h $(git ls-files cc)
2 changes: 1 addition & 1 deletion cc/include/TableGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions cc/lib/RecordVal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -58,8 +58,8 @@ tableGenRecordValGetValAsDefRecord(TableGenRecordValRef rv_ref) {
wrap(dyn_cast<TypedInit>(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);
}
Expand Down
2 changes: 1 addition & 1 deletion cc/lib/TableGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
11 changes: 7 additions & 4 deletions cc/lib/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<SMLoc> Loc = *unwrap(loc_ref);

Expand Down Expand Up @@ -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)));
}

Expand Down
Loading