Skip to content

Commit 6b8db4b

Browse files
committed
Apply clang-format
1 parent 2531335 commit 6b8db4b

File tree

12 files changed

+17
-26
lines changed

12 files changed

+17
-26
lines changed

Diff for: src/LLVMBackend/Generator.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void runCmd(const vector<string>& args) {
7272
if (s.verbose_)
7373
cout << " " << arg;
7474
}
75-
cstrArgs.push_back(nullptr); // Required until LLVM 7
75+
cstrArgs.push_back(nullptr); // Required until LLVM 7
7676
#else
7777
// Transform the strings into a vector of llvm::StringRef, as required by ExecuteAndWait
7878
vector<llvm::StringRef> llvmArgs;
@@ -114,7 +114,6 @@ void writeBitcodeFile(const Module& module, const string& outputFilename) {
114114
REP_INTERNAL(NOLOC, "Cannot generate bitcode file (%1%); reason: %2%") % outputFilename %
115115
errorInfo;
116116

117-
118117
#if LLVM_VERSION_MAJOR < 7
119118
llvm::WriteBitcodeToFile(&module, outFile->os());
120119
#else

Diff for: src/Nest/Utils/Profiling.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ inline void _Nest_Profiling_message(Nest_StringRef text) {
5454
typedef TracyCZoneCtx Nest_Profiling_ZoneCtx;
5555

5656
#define PROFILING_C_ZONE_BEGIN_NAME(ctx, staticName, active) \
57-
static const Nest_Profiling_LocType TracyConcat(__tracy_source_location, __LINE__) = { \
57+
static const Nest_Profiling_LocType TracyConcat(__tracy_source_location, __LINE__) = { \
5858
staticName, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0}; \
5959
Nest_Profiling_ZoneCtx ctx = \
6060
___tracy_emit_zone_begin(&TracyConcat(__tracy_source_location, __LINE__), active);

Diff for: src/Nest/src/Api/Node.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ void _setProfilingText(Nest_Profiling_ZoneCtx ctx, Nest_Node* node) {
9393
#define PROFILING_C_ZONE_SETNODETEXT(ctx, node) /*nothing*/
9494
#endif
9595

96-
9796
Nest_Node* Nest_createNode(int nodeKind) {
9897
ASSERT(nodeKind >= 0);
9998

@@ -136,7 +135,7 @@ void Nest_setContext(Nest_Node* node, Nest_CompilationContext* context) {
136135
return;
137136

138137
int changingContext = node->context && node->context != context;
139-
(void) changingContext;
138+
(void)changingContext;
140139

141140
PROFILING_C_ZONE_BEGIN_LOC(ctx, Nest_Profiling_getSetContextLoc(node->nodeKind));
142141

Diff for: src/Nest/src/Api/NodeKindRegistrar.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ int Nest_registerNodeKind(const char* name, FSemanticCheck funSemanticCheck,
4747
funToString = Nest_defaultFunToString;
4848

4949
#if SPARROW_PROFILING
50-
const Nest_Profiling_LocType* setContextLoc =
51-
Nest_Profiling_createLoc(strconcat("setCtx ", name), "Nest_setContext", "Node.c",
52-
1, 0x4f94cd); // SteelBlue3
53-
const Nest_Profiling_LocType* computeTypeLoc =
54-
Nest_Profiling_createLoc(strconcat("compType ", name), "Nest_computeType", "Node.c",
55-
1, 0x36648b); // SteelBlue4
50+
const Nest_Profiling_LocType* setContextLoc = Nest_Profiling_createLoc(
51+
strconcat("setCtx ", name), "Nest_setContext", "Node.c", 1, 0x4f94cd); // SteelBlue3
52+
const Nest_Profiling_LocType* computeTypeLoc = Nest_Profiling_createLoc(
53+
strconcat("compType ", name), "Nest_computeType", "Node.c", 1, 0x36648b); // SteelBlue4
5654
const Nest_Profiling_LocType* semanticCheckLoc =
5755
Nest_Profiling_createLoc(strconcat("semCheck ", name), "Nest_semanticCheck", "Node.c",
5856
1, 0x27408b); // RoyalBlue4

Diff for: src/SparrowFrontend/Helpers/Generics.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ bool isConceptParam(Type paramType, NodeHandle boundValue) {
325325
return isConceptType(paramType) || paramType.mode() != modeCt;
326326
}
327327

328-
329328
IterativeInstantiationBuilder::IterativeInstantiationBuilder(
330329
InstantiationsSet instSet, int numParams, EvalMode finalEvalMode, bool isCtGeneric)
331330
: instSet_(instSet)

Diff for: src/SparrowFrontend/Helpers/Generics.h

-1
Original file line numberDiff line numberDiff line change
@@ -257,5 +257,4 @@ class IterativeInstantiationBuilder {
257257
NodeHandle existingBoundVal(int idx) const;
258258
};
259259

260-
261260
} // namespace SprFrontend

Diff for: src/SparrowFrontend/Helpers/Impl/Intrinsics.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ NodeHandle impl_typeChangeRefCount(
7777
return createTypeNode(context, loc, res);
7878
}
7979

80-
NodeHandle impl_typeRemoveCat(
81-
CompilationContext* context, const Location& loc, NodeRange args) {
80+
NodeHandle impl_typeRemoveCat(CompilationContext* context, const Location& loc, NodeRange args) {
8281
CHECK(loc, args.size() == 1);
8382
Type t = getType(args[0]);
8483

Diff for: src/SparrowFrontend/Mods.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void ModConvert_beforeComputeType(Nest_Modifier*, Node* node) {
7676
void ModNoDefault_beforeComputeType(Nest_Modifier*, Node* node) {
7777
/// Check to apply only to datatypes or functions
7878
if (node->nodeKind != nkSparrowDeclSprFunction && node->nodeKind != nkSparrowDeclSprDatatype)
79-
REP_INTERNAL(node->location,
80-
"noDefault modifier can be applied only to datatypes or functions (applied to %1%)") %
79+
REP_INTERNAL(node->location, "noDefault modifier can be applied only to datatypes or "
80+
"functions (applied to %1%)") %
8181
Nest_nodeKindName(node);
8282

8383
Nest_setPropertyInt(node, propNoDefault, 1);
@@ -152,7 +152,8 @@ Nest_Modifier _convertMod = {modTypeBeforeComputeType, &ModConvert_beforeCompute
152152
Nest_Modifier _noDefaultMod = {modTypeBeforeComputeType, &ModNoDefault_beforeComputeType};
153153
Nest_Modifier _initCtorMod = {modTypeBeforeComputeType, ModInitCtor_beforeComputeType};
154154
Nest_Modifier _bitCopiableMod = {modTypeBeforeComputeType, &ModBitCopiable_beforeComputeType};
155-
Nest_Modifier _autoBitCopiableMod = {modTypeBeforeComputeType, &ModAutoBitCopiable_beforeComputeType};
155+
Nest_Modifier _autoBitCopiableMod = {
156+
modTypeBeforeComputeType, &ModAutoBitCopiable_beforeComputeType};
156157
Nest_Modifier _macroMod = {modTypeBeforeComputeType, &ModMacro_beforeComputeType};
157158
Nest_Modifier _noInlineMod = {modTypeBeforeComputeType, &ModNoInline_beforeComputeType};
158159

Diff for: src/SparrowFrontend/Nodes/Decl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ Type DataTypeDecl::computeTypeImpl(DataTypeDecl node) {
691691
resultingStruct.addChildren(all(fields));
692692

693693
// Check for autoBitcopiable
694-
if ( node.hasProperty(propAutoBitCopiable)) {
694+
if (node.hasProperty(propAutoBitCopiable)) {
695695
bool allAreBitcopiable = true;
696696
for (auto f : fields) {
697697
ASSERT(f->type);

Diff for: src/SparrowFrontend/Services/Callable/CallableHelpers.h

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ struct ParameterDecl;
1717
bool shouldUseCt(Feather::DeclNode decl, bool autoCt, Range<Type> argTypes, EvalMode evalMode);
1818
bool shouldUseCt(Feather::DeclNode decl, bool autoCt, Range<NodeHandle> args, EvalMode evalMode);
1919

20-
2120
/**
2221
* @brief Completes the given 'args' with the default values found in the given parameters
2322
*

Diff for: src/SparrowFrontend/Services/Callable/FunctionCallable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ NodeHandle FunctionCallable::generateCall(const CCLoc& ccloc) {
191191

192192
int FunctionCallable::numParams() const {
193193
int res = params_.size();
194-
return implicitArgType_ ? res-1 : res;
194+
return implicitArgType_ ? res - 1 : res;
195195
}
196196

197197
Type FunctionCallable::paramType(int idx) const {

Diff for: src/SparrowFrontend/Services/Convert/ConvertServiceImpl.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,12 @@ bool ConvertServiceImpl::adjustReferences(ConversionResult& res, TypeWithStorage
344344
ConvType conv = conversions[srcIdx][destIdx];
345345
// TODO (types): Remove this after finalizing mutables
346346
// A reference can be converted to mutable
347-
if (srcIdx == 0 && destIdx == 2 && srcRefsBase > destRefsBase)
348-
{
349-
for (int i=destRefsBase; i<srcRefsBase-1; i++)
350-
{
347+
if (srcIdx == 0 && destIdx == 2 && srcRefsBase > destRefsBase) {
348+
for (int i = destRefsBase; i < srcRefsBase - 1; i++) {
351349
src = removeCatOrRef(src);
352350
res.addConversion(convImplicit, ConvAction(ActionType::dereference, src));
353351
}
354-
ASSERT(src.numReferences() == destRefsBase+1);
352+
ASSERT(src.numReferences() == destRefsBase + 1);
355353
src = MutableType::get(removeRef(src));
356354
res.addConversion(convImplicit, ConvAction(ActionType::bitcast, src));
357355
return true;

0 commit comments

Comments
 (0)