r341254 - [WebAssembly] clang-format (NFC)
Heejin Ahn via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 31 13:57:00 PDT 2018
Author: aheejin
Date: Fri Aug 31 13:57:00 2018
New Revision: 341254
URL: http://llvm.org/viewvc/llvm-project?rev=341254&view=rev
Log:
[WebAssembly] clang-format (NFC)
Summary: This patch runs clang-format on all wasm-only files.
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D51448
Modified:
cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp
cfe/trunk/lib/Driver/ToolChains/WebAssembly.h
cfe/trunk/test/CodeGen/builtins-wasm.c
cfe/trunk/test/CodeGen/wasm-arguments.c
cfe/trunk/test/CodeGen/wasm-varargs.c
cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp
cfe/trunk/test/CodeGenCXX/wasm-args-returns.cpp
cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp
cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp
Modified: cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp Fri Aug 31 13:57:00 2018
@@ -22,15 +22,11 @@ using namespace clang;
using namespace llvm::opt;
wasm::Linker::Linker(const ToolChain &TC)
- : GnuTool("wasm::Linker", "lld", TC) {}
+ : GnuTool("wasm::Linker", "lld", TC) {}
-bool wasm::Linker::isLinkJob() const {
- return true;
-}
+bool wasm::Linker::isLinkJob() const { return true; }
-bool wasm::Linker::hasIntegratedCPP() const {
- return false;
-}
+bool wasm::Linker::hasIntegratedCPP() const { return false; }
void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
@@ -73,7 +69,7 @@ void wasm::Linker::ConstructJob(Compilat
WebAssembly::WebAssembly(const Driver &D, const llvm::Triple &Triple,
const llvm::opt::ArgList &Args)
- : ToolChain(D, Triple, Args) {
+ : ToolChain(D, Triple, Args) {
assert(Triple.isArch32Bit() != Triple.isArch64Bit());
@@ -115,7 +111,8 @@ ToolChain::RuntimeLibType WebAssembly::G
return ToolChain::RLT_CompilerRT;
}
-ToolChain::CXXStdlibType WebAssembly::GetCXXStdlibType(const ArgList &Args) const {
+ToolChain::CXXStdlibType
+WebAssembly::GetCXXStdlibType(const ArgList &Args) const {
if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
StringRef Value = A->getValue();
if (Value != "libc++")
Modified: cfe/trunk/lib/Driver/ToolChains/WebAssembly.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/WebAssembly.h?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/WebAssembly.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/WebAssembly.h Fri Aug 31 13:57:00 2018
@@ -51,14 +51,15 @@ private:
bool hasBlocksRuntime() const override;
bool SupportsProfiling() const override;
bool HasNativeLLVMSupport() const override;
- void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args,
- Action::OffloadKind DeviceOffloadKind) const override;
+ void
+ addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args,
+ Action::OffloadKind DeviceOffloadKind) const override;
RuntimeLibType GetDefaultRuntimeLibType() const override;
CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
- void AddClangSystemIncludeArgs(
- const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const override;
+ void
+ AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
void AddClangCXXStdlibIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
Modified: cfe/trunk/test/CodeGen/builtins-wasm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-wasm.c?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-wasm.c (original)
+++ cfe/trunk/test/CodeGen/builtins-wasm.c Fri Aug 31 13:57:00 2018
@@ -5,66 +5,66 @@
__SIZE_TYPE__ f0(void) {
return __builtin_wasm_memory_size(0);
-// WEBASSEMBLY32: call {{i.*}} @llvm.wasm.memory.size.i32(i32 0)
-// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.memory.size.i64(i32 0)
+ // WEBASSEMBLY32: call {{i.*}} @llvm.wasm.memory.size.i32(i32 0)
+ // WEBASSEMBLY64: call {{i.*}} @llvm.wasm.memory.size.i64(i32 0)
}
__SIZE_TYPE__ f1(__SIZE_TYPE__ delta) {
return __builtin_wasm_memory_grow(0, delta);
-// WEBASSEMBLY32: call i32 @llvm.wasm.memory.grow.i32(i32 0, i32 %{{.*}})
-// WEBASSEMBLY64: call i64 @llvm.wasm.memory.grow.i64(i32 0, i64 %{{.*}})
+ // WEBASSEMBLY32: call i32 @llvm.wasm.memory.grow.i32(i32 0, i32 %{{.*}})
+ // WEBASSEMBLY64: call i64 @llvm.wasm.memory.grow.i64(i32 0, i64 %{{.*}})
}
__SIZE_TYPE__ f2(void) {
return __builtin_wasm_mem_size(0);
-// WEBASSEMBLY32: call {{i.*}} @llvm.wasm.mem.size.i32(i32 0)
-// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.mem.size.i64(i32 0)
+ // WEBASSEMBLY32: call {{i.*}} @llvm.wasm.mem.size.i32(i32 0)
+ // WEBASSEMBLY64: call {{i.*}} @llvm.wasm.mem.size.i64(i32 0)
}
__SIZE_TYPE__ f3(__SIZE_TYPE__ delta) {
return __builtin_wasm_mem_grow(0, delta);
-// WEBASSEMBLY32: call i32 @llvm.wasm.mem.grow.i32(i32 0, i32 %{{.*}})
-// WEBASSEMBLY64: call i64 @llvm.wasm.mem.grow.i64(i32 0, i64 %{{.*}})
+ // WEBASSEMBLY32: call i32 @llvm.wasm.mem.grow.i32(i32 0, i32 %{{.*}})
+ // WEBASSEMBLY64: call i64 @llvm.wasm.mem.grow.i64(i32 0, i64 %{{.*}})
}
__SIZE_TYPE__ f4(void) {
return __builtin_wasm_current_memory();
-// WEBASSEMBLY32: call {{i.*}} @llvm.wasm.current.memory.i32()
-// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.current.memory.i64()
+ // WEBASSEMBLY32: call {{i.*}} @llvm.wasm.current.memory.i32()
+ // WEBASSEMBLY64: call {{i.*}} @llvm.wasm.current.memory.i64()
}
__SIZE_TYPE__ f5(__SIZE_TYPE__ delta) {
return __builtin_wasm_grow_memory(delta);
-// WEBASSEMBLY32: call i32 @llvm.wasm.grow.memory.i32(i32 %{{.*}})
-// WEBASSEMBLY64: call i64 @llvm.wasm.grow.memory.i64(i64 %{{.*}})
+ // WEBASSEMBLY32: call i32 @llvm.wasm.grow.memory.i32(i32 %{{.*}})
+ // WEBASSEMBLY64: call i64 @llvm.wasm.grow.memory.i64(i64 %{{.*}})
}
void f6(unsigned int tag, void *obj) {
return __builtin_wasm_throw(tag, obj);
-// WEBASSEMBLY32: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}})
-// WEBASSEMBLY64: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}})
+ // WEBASSEMBLY32: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}})
+ // WEBASSEMBLY64: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}})
}
void f7(void) {
return __builtin_wasm_rethrow();
-// WEBASSEMBLY32: call void @llvm.wasm.rethrow()
-// WEBASSEMBLY64: call void @llvm.wasm.rethrow()
+ // WEBASSEMBLY32: call void @llvm.wasm.rethrow()
+ // WEBASSEMBLY64: call void @llvm.wasm.rethrow()
}
int f8(int *addr, int expected, long long timeout) {
return __builtin_wasm_atomic_wait_i32(addr, expected, timeout);
-// WEBASSEMBLY32: call i32 @llvm.wasm.atomic.wait.i32(i32* %{{.*}}, i32 %{{.*}}, i64 %{{.*}})
-// WEBASSEMBLY64: call i32 @llvm.wasm.atomic.wait.i32(i32* %{{.*}}, i32 %{{.*}}, i64 %{{.*}})
+ // WEBASSEMBLY32: call i32 @llvm.wasm.atomic.wait.i32(i32* %{{.*}}, i32 %{{.*}}, i64 %{{.*}})
+ // WEBASSEMBLY64: call i32 @llvm.wasm.atomic.wait.i32(i32* %{{.*}}, i32 %{{.*}}, i64 %{{.*}})
}
int f9(long long *addr, long long expected, long long timeout) {
return __builtin_wasm_atomic_wait_i64(addr, expected, timeout);
-// WEBASSEMBLY32: call i32 @llvm.wasm.atomic.wait.i64(i64* %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
-// WEBASSEMBLY64: call i32 @llvm.wasm.atomic.wait.i64(i64* %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
+ // WEBASSEMBLY32: call i32 @llvm.wasm.atomic.wait.i64(i64* %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
+ // WEBASSEMBLY64: call i32 @llvm.wasm.atomic.wait.i64(i64* %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
}
unsigned int f10(int *addr, int count) {
return __builtin_wasm_atomic_notify(addr, count);
-// WEBASSEMBLY32: call i32 @llvm.wasm.atomic.notify(i32* %{{.*}}, i32 %{{.*}})
-// WEBASSEMBLY64: call i32 @llvm.wasm.atomic.notify(i32* %{{.*}}, i32 %{{.*}})
+ // WEBASSEMBLY32: call i32 @llvm.wasm.atomic.notify(i32* %{{.*}}, i32 %{{.*}})
+ // WEBASSEMBLY64: call i32 @llvm.wasm.atomic.notify(i32* %{{.*}}, i32 %{{.*}})
}
Modified: cfe/trunk/test/CodeGen/wasm-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/wasm-arguments.c?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/wasm-arguments.c (original)
+++ cfe/trunk/test/CodeGen/wasm-arguments.c Fri Aug 31 13:57:00 2018
@@ -54,7 +54,6 @@ void f5(char a, short b) {}
// WEBASSEMBLY64: define void @f6(i8 zeroext %a, i16 zeroext %b)
void f6(unsigned char a, unsigned short b) {}
-
enum my_enum {
ENUM1,
ENUM2,
Modified: cfe/trunk/test/CodeGen/wasm-varargs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/wasm-varargs.c?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/wasm-varargs.c (original)
+++ cfe/trunk/test/CodeGen/wasm-varargs.c Fri Aug 31 13:57:00 2018
@@ -65,9 +65,9 @@ long long test_i64(char *fmt, ...) {
// CHECK: }
struct S {
- int x;
- int y;
- int z;
+ int x;
+ int y;
+ int z;
};
struct S test_struct(char *fmt, ...) {
Modified: cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp Fri Aug 31 13:57:00 2018
@@ -38,7 +38,7 @@ void g() {
// Test various aspects of static constructor calls.
struct A {
- A();
+ A();
};
A theA;
Modified: cfe/trunk/test/CodeGenCXX/wasm-args-returns.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/wasm-args-returns.cpp?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/wasm-args-returns.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/wasm-args-returns.cpp Fri Aug 31 13:57:00 2018
@@ -3,16 +3,18 @@
// RUN: %clang_cc1 -O1 -triple wasm64-unknown-unknown -emit-llvm -o - %s \
// RUN: | FileCheck %s
-#define concat_(x, y) x ## y
+#define concat_(x, y) x##y
#define concat(x, y) concat_(x, y)
-#define test(T) \
+#define test(T) \
T forward(T x) { return x; } \
- void use(T x); \
- T concat(def_, T)(void); \
+ void use(T x); \
+ T concat(def_, T)(void); \
void concat(test_, T)(void) { use(concat(def_, T)()); }
-struct one_field { double d; };
+struct one_field {
+ double d;
+};
test(one_field);
// CHECK: define double @_Z7forward9one_field(double returned %{{.*}})
//
@@ -24,7 +26,9 @@ test(one_field);
// CHECK: declare void @_Z3use9one_field(double)
// CHECK: declare double @_Z13def_one_fieldv()
-struct two_fields { double d, e; };
+struct two_fields {
+ double d, e;
+};
test(two_fields);
// CHECK: define void @_Z7forward10two_fields(%struct.two_fields* noalias nocapture sret %{{.*}}, %struct.two_fields* byval nocapture readonly align 8 %{{.*}})
//
@@ -38,8 +42,8 @@ test(two_fields);
// CHECK: declare void @_Z14def_two_fieldsv(%struct.two_fields* sret)
struct copy_ctor {
- double d;
- copy_ctor(copy_ctor const&);
+ double d;
+ copy_ctor(copy_ctor const &);
};
test(copy_ctor);
// CHECK: define void @_Z7forward9copy_ctor(%struct.copy_ctor* noalias sret %{{.*}}, %struct.copy_ctor* %{{.*}})
@@ -56,8 +60,8 @@ test(copy_ctor);
// CHECK: declare void @_Z13def_copy_ctorv(%struct.copy_ctor* sret)
struct __attribute__((aligned(16))) aligned_copy_ctor {
- double d, e;
- aligned_copy_ctor(aligned_copy_ctor const&);
+ double d, e;
+ aligned_copy_ctor(aligned_copy_ctor const &);
};
test(aligned_copy_ctor);
// CHECK: define void @_Z7forward17aligned_copy_ctor(%struct.aligned_copy_ctor* noalias sret %{{.*}}, %struct.aligned_copy_ctor* %{{.*}})
@@ -86,7 +90,7 @@ test(empty);
// CHECK: declare void @_Z9def_emptyv()
struct one_bitfield {
- int d:3;
+ int d : 3;
};
test(one_bitfield);
// CHECK: define i32 @_Z7forward12one_bitfield(i32 returned %{{.*}})
Modified: cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp (original)
+++ cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp Fri Aug 31 13:57:00 2018
@@ -29,7 +29,7 @@ int align_l = __alignof(long);
int align_ll = __alignof(long long);
// CHECK: @align_p = hidden global i32 4
-int align_p = __alignof(void*);
+int align_p = __alignof(void *);
// CHECK: @align_f = hidden global i32 4
int align_f = __alignof(float);
@@ -99,17 +99,20 @@ double check_double() { return 0; }
// CHECK: fp128 @check_longdouble()
long double check_longdouble() { return 0; }
-
}
-template<int> void Switch();
-template<> void Switch<4>();
-template<> void Switch<8>();
-template<> void Switch<16>();
+template <int>
+void Switch();
+template <>
+void Switch<4>();
+template <>
+void Switch<8>();
+template <>
+void Switch<16>();
void check_pointer_size() {
// CHECK: SwitchILi4
- Switch<sizeof(void*)>();
+ Switch<sizeof(void *)>();
// CHECK: SwitchILi8
Switch<sizeof(long long)>();
Modified: cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp?rev=341254&r1=341253&r2=341254&view=diff
==============================================================================
--- cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp (original)
+++ cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp Fri Aug 31 13:57:00 2018
@@ -29,7 +29,7 @@ int align_l = __alignof(long);
int align_ll = __alignof(long long);
// CHECK: @align_p = hidden global i32 8
-int align_p = __alignof(void*);
+int align_p = __alignof(void *);
// CHECK: @align_f = hidden global i32 4
int align_f = __alignof(float);
@@ -99,17 +99,20 @@ double check_double() { return 0; }
// CHECK: fp128 @check_longdouble()
long double check_longdouble() { return 0; }
-
}
-template<int> void Switch();
-template<> void Switch<4>();
-template<> void Switch<8>();
-template<> void Switch<16>();
+template <int>
+void Switch();
+template <>
+void Switch<4>();
+template <>
+void Switch<8>();
+template <>
+void Switch<16>();
void check_pointer_size() {
// CHECK: SwitchILi8
- Switch<sizeof(void*)>();
+ Switch<sizeof(void *)>();
// CHECK: SwitchILi8
Switch<sizeof(long long)>();
More information about the cfe-commits
mailing list