Commit c0c916c4 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Add clang-format rules and makefile targets

Will commit the result in the next changeset.

Also, had to update to a newer version of LLVM to get some new clang-format options.
We don't necessarily have to use the same version of clang-format as the version of
llvm that we build it against, but if we can it keeps the build system simpler.
parent 0b890b0b
From c3bb0f324eaa62996ccea2751af8dbb7a6c08368 Mon Sep 17 00:00:00 2001
From: Juergen Ributzka <juergen@apple.com>
Date: Wed, 5 Feb 2014 15:06:36 -0800
Subject: [PATCH 1/1] [Stackmaps] Update the stackmap format to use 64bit
relocations for the function address and properly align all entries.
---
docs/StackMaps.rst | 10 +++--
include/llvm/CodeGen/StackMaps.h | 2 +-
lib/CodeGen/StackMaps.cpp | 49 ++++++++++++---------
test/CodeGen/X86/anyregcc.ll | 41 ++++++++++--------
test/CodeGen/X86/stackmap-liveness.ll | 81 ++++++++++++++++++++++++++++++-----
test/CodeGen/X86/stackmap.ll | 68 +++++++++++++++--------------
6 files changed, 166 insertions(+), 85 deletions(-)
diff --git a/docs/StackMaps.rst b/docs/StackMaps.rst
index 57c37ea..dbf30ad 100644
--- a/docs/StackMaps.rst
+++ b/docs/StackMaps.rst
@@ -315,15 +315,15 @@ format of this section follows:
uint32 : Reserved (header)
uint32 : NumFunctions
+ uint32 : NumConstants
+ uint32 : NumRecords
StkSizeRecord[NumFunctions] {
- uint32 : Function Offset
- uint32 : Stack Size
+ uint64 : Function Address
+ uint64 : Stack Size
}
- uint32 : NumConstants
Constants[NumConstants] {
uint64 : LargeConstant
}
- uint32 : NumRecords
StkMapRecord[NumRecords] {
uint64 : PatchPoint ID
uint32 : Instruction Offset
@@ -335,12 +335,14 @@ format of this section follows:
uint16 : Dwarf RegNum
int32 : Offset or SmallConstant
}
+ uint16 : Padding
uint16 : NumLiveOuts
LiveOuts[NumLiveOuts]
uint16 : Dwarf RegNum
uint8 : Reserved
uint8 : Size in Bytes
}
+ uint32 : Padding (only if required to align to 8 byte)
}
The first byte of each location encodes a type that indicates how to
diff --git a/include/llvm/CodeGen/StackMaps.h b/include/llvm/CodeGen/StackMaps.h
index bd4c3db..9ea1f57 100644
--- a/include/llvm/CodeGen/StackMaps.h
+++ b/include/llvm/CodeGen/StackMaps.h
@@ -133,7 +133,7 @@ public:
private:
typedef SmallVector<Location, 8> LocationVec;
typedef SmallVector<LiveOutReg, 8> LiveOutVec;
- typedef MapVector<const MCSymbol *, uint32_t> FnStackSizeMap;
+ typedef MapVector<const MCSymbol *, uint64_t> FnStackSizeMap;
struct CallsiteInfo {
const MCExpr *CSOffsetExpr;
diff --git a/lib/CodeGen/StackMaps.cpp b/lib/CodeGen/StackMaps.cpp
index 1ec2587..df649f3 100644
--- a/lib/CodeGen/StackMaps.cpp
+++ b/lib/CodeGen/StackMaps.cpp
@@ -230,7 +230,7 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID,
// Record the stack size of the current function.
const MachineFrameInfo *MFI = AP.MF->getFrameInfo();
FnStackSize[AP.CurrentFnSym] =
- MFI->hasVarSizedObjects() ? ~0U : MFI->getStackSize();
+ MFI->hasVarSizedObjects() ? UINT64_MAX : MFI->getStackSize();
}
void StackMaps::recordStackMap(const MachineInstr &MI) {
@@ -268,13 +268,13 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) {
///
/// uint32 : Reserved (header)
/// uint32 : NumFunctions
+/// uint32 : NumConstants
+/// uint32 : NumRecords
/// StkSizeRecord[NumFunctions] {
-/// uint32 : Function Offset
-/// uint32 : Stack Size
+/// uint64 : Function Address
+/// uint64 : Stack Size
/// }
-/// uint32 : NumConstants
/// int64 : Constants[NumConstants]
-/// uint32 : NumRecords
/// StkMapRecord[NumRecords] {
/// uint64 : PatchPoint ID
/// uint32 : Instruction Offset
@@ -286,11 +286,14 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) {
/// uint16 : Dwarf RegNum
/// int32 : Offset
/// }
+/// uint16 : Padding
/// uint16 : NumLiveOuts
-/// LiveOuts[NumLiveOuts]
+/// LiveOuts[NumLiveOuts] {
/// uint16 : Dwarf RegNum
/// uint8 : Reserved
/// uint8 : Size in Bytes
+/// }
+/// uint32 : Padding (only if required to align to 8 byte)
/// }
///
/// Location Encoding, Type, Value:
@@ -324,33 +327,33 @@ void StackMaps::serializeToStackMapSection() {
DEBUG(dbgs() << "********** Stack Map Output **********\n");
- // Header.
+ /// --- Header ---
AP.OutStreamer.EmitIntValue(0, 4);
-
// Num functions.
+ DEBUG(dbgs() << WSMP << "#functions = " << FnStackSize.size() << '\n');
AP.OutStreamer.EmitIntValue(FnStackSize.size(), 4);
+ // Num constants.
+ DEBUG(dbgs() << WSMP << "#constants = " << ConstPool.getNumConstants()
+ << '\n');
+ AP.OutStreamer.EmitIntValue(ConstPool.getNumConstants(), 4);
+ // Num callsites.
+ DEBUG(dbgs() << WSMP << "#callsites = " << CSInfos.size() << '\n');
+ AP.OutStreamer.EmitIntValue(CSInfos.size(), 4);
- // Stack size entries.
+ // Function stack size entries.
for (FnStackSizeMap::iterator I = FnStackSize.begin(), E = FnStackSize.end();
I != E; ++I) {
- AP.OutStreamer.EmitSymbolValue(I->first, 4);
- AP.OutStreamer.EmitIntValue(I->second, 4);
+ AP.OutStreamer.EmitSymbolValue(I->first, 8);
+ AP.OutStreamer.EmitIntValue(I->second, 8);
}
- // Num constants.
- AP.OutStreamer.EmitIntValue(ConstPool.getNumConstants(), 4);
-
// Constant pool entries.
for (unsigned i = 0; i < ConstPool.getNumConstants(); ++i)
AP.OutStreamer.EmitIntValue(ConstPool.getConstant(i), 8);
- DEBUG(dbgs() << WSMP << "#callsites = " << CSInfos.size() << "\n");
- AP.OutStreamer.EmitIntValue(CSInfos.size(), 4);
-
+ // Callsite entries.
for (CallsiteInfoList::const_iterator CSII = CSInfos.begin(),
- CSIE = CSInfos.end();
- CSII != CSIE; ++CSII) {
-
+ CSIE = CSInfos.end(); CSII != CSIE; ++CSII) {
uint64_t CallsiteID = CSII->ID;
const LocationVec &CSLocs = CSII->Locations;
const LiveOutVec &LiveOuts = CSII->LiveOuts;
@@ -366,7 +369,9 @@ void StackMaps::serializeToStackMapSection() {
AP.OutStreamer.EmitValue(CSII->CSOffsetExpr, 4);
AP.OutStreamer.EmitIntValue(0, 2); // Reserved.
AP.OutStreamer.EmitIntValue(0, 2); // 0 locations.
+ AP.OutStreamer.EmitIntValue(0, 2); // padding.
AP.OutStreamer.EmitIntValue(0, 2); // 0 live-out registers.
+ AP.OutStreamer.EmitIntValue(0, 4); // padding.
continue;
}
@@ -447,6 +452,8 @@ void StackMaps::serializeToStackMapSection() {
DEBUG(dbgs() << WSMP << " has " << LiveOuts.size()
<< " live-out registers\n");
+ // Num live-out registers and padding to align to 4 byte.
+ AP.OutStreamer.EmitIntValue(0, 2);
AP.OutStreamer.EmitIntValue(LiveOuts.size(), 2);
operIdx = 0;
@@ -461,6 +468,8 @@ void StackMaps::serializeToStackMapSection() {
AP.OutStreamer.EmitIntValue(0, 1);
AP.OutStreamer.EmitIntValue(LI->Size, 1);
}
+ // Emit alignment to 8 byte.
+ AP.OutStreamer.EmitValueToAlignment(8);
}
AP.OutStreamer.AddBlankLine();
diff --git a/test/CodeGen/X86/anyregcc.ll b/test/CodeGen/X86/anyregcc.ll
index 23f5d43..6adbc1b 100644
--- a/test/CodeGen/X86/anyregcc.ll
+++ b/test/CodeGen/X86/anyregcc.ll
@@ -10,27 +10,32 @@
; CHECK-NEXT: .long 0
; Num Functions
; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _test
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _property_access1
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _property_access2
-; CHECK-NEXT: .long 24
-; CHECK-NEXT: .long _property_access3
-; CHECK-NEXT: .long 24
-; CHECK-NEXT: .long _anyreg_test1
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _anyreg_test2
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _patchpoint_spilldef
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _patchpoint_spillargs
-; CHECK-NEXT: .long 88
; Num Constants
-; CHECK-NEXT: .long 0
+; CHECK-NEXT: .long 0
; Num Callsites
-; CHECK-NEXT: .long 8
+; CHECK-NEXT: .long 8
+
+; Functions and stack size
+; CHECK-NEXT: .quad _test
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _property_access1
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _property_access2
+; CHECK-NEXT: .quad 24
+; CHECK-NEXT: .quad _property_access3
+; CHECK-NEXT: .quad 24
+; CHECK-NEXT: .quad _anyreg_test1
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _anyreg_test2
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _patchpoint_spilldef
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _patchpoint_spillargs
+; CHECK-NEXT: .quad 88
+
+; No constants
+; Callsites
; test
; CHECK-LABEL: .long L{{.*}}-_test
; CHECK-NEXT: .short 0
diff --git a/test/CodeGen/X86/stackmap-liveness.ll b/test/CodeGen/X86/stackmap-liveness.ll
index 570e373..2b56750 100644
--- a/test/CodeGen/X86/stackmap-liveness.ll
+++ b/test/CodeGen/X86/stackmap-liveness.ll
@@ -6,17 +6,21 @@
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps:
+; Header
; CHECK-NEXT: .long 0
; Num Functions
; CHECK-NEXT: .long 2
-; CHECK-NEXT: .long _stackmap_liveness
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _mixed_liveness
-; CHECK-NEXT: .long 8
; Num LargeConstants
; CHECK-NEXT: .long 0
; Num Callsites
; CHECK-NEXT: .long 5
+
+; Functions and stack size
+; CHECK-NEXT: .quad _stackmap_liveness
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _mixed_liveness
+; CHECK-NEXT: .quad 8
+
define void @stackmap_liveness() {
entry:
%a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
@@ -24,13 +28,19 @@ entry:
; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
; CHECK-NEXT: .short 0
; CHECK-NEXT: .short 0
+; Padding
+; CHECK-NEXT: .short 0
; Num LiveOut Entries: 0
; CHECK-NEXT: .short 0
+; Align
+; CHECK-NEXT: .align 3
; StackMap 1 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
; STACK-NEXT: .short 0
; STACK-NEXT: .short 0
+; Padding
+; STACK-NEXT: .short 0
; Num LiveOut Entries: 2
; STACK-NEXT: .short 2
; LiveOut Entry 1: %RSP (8 bytes)
@@ -41,13 +51,19 @@ entry:
; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16
+; Align
+; STACK-NEXT: .align 3
; StackMap 1 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0
+; Padding
+; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0
+; Align
+; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 5)
%a2 = call i64 asm sideeffect "", "={r8}"() nounwind
%a3 = call i8 asm sideeffect "", "={ah}"() nounwind
@@ -58,16 +74,22 @@ entry:
; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
; CHECK-NEXT: .short 0
; CHECK-NEXT: .short 0
+; Padding
+; CHECK-NEXT: .short 0
; Num LiveOut Entries: 0
; CHECK-NEXT: .short 0
+; Align
+; CHECK-NEXT: .align 3
; StackMap 2 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
; STACK-NEXT: .short 0
; STACK-NEXT: .short 0
+; Padding
+; STACK-NEXT: .short 0
; Num LiveOut Entries: 6
; STACK-NEXT: .short 6
-; LiveOut Entry 2: %RAX (1 bytes) --> %AL or %AH
+; LiveOut Entry 1: %RAX (1 bytes) --> %AL or %AH
; STACK-NEXT: .short 0
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 1
@@ -75,29 +97,35 @@ entry:
; STACK-NEXT: .short 7
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 8
-; LiveOut Entry 2: %R8 (8 bytes)
+; LiveOut Entry 3: %R8 (8 bytes)
; STACK-NEXT: .short 8
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 8
-; LiveOut Entry 2: %YMM0 (32 bytes)
+; LiveOut Entry 4: %YMM0 (32 bytes)
; STACK-NEXT: .short 17
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 32
-; LiveOut Entry 2: %YMM1 (32 bytes)
+; LiveOut Entry 5: %YMM1 (32 bytes)
; STACK-NEXT: .short 18
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 32
-; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
+; LiveOut Entry 6: %YMM2 (16 bytes) --> %XMM2
; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16
+; Align
+; STACK-NEXT: .align 3
; StackMap 2 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0
+; Padding
+; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0
+; Align
+; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 2, i32 5)
call void asm sideeffect "", "{r8},{ah},{ymm0},{ymm1}"(i64 %a2, i8 %a3, <4 x double> %a4, <4 x double> %a5) nounwind
@@ -105,16 +133,22 @@ entry:
; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
; CHECK-NEXT: .short 0
; CHECK-NEXT: .short 0
+; Padding
+; CHECK-NEXT: .short 0
; Num LiveOut Entries: 0
; CHECK-NEXT: .short 0
+; Align
+; CHECK-NEXT: .align 3
; StackMap 3 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
; STACK-NEXT: .short 0
; STACK-NEXT: .short 0
+; Padding
+; STACK-NEXT: .short 0
; Num LiveOut Entries: 2
; STACK-NEXT: .short 2
-; LiveOut Entry 2: %RSP (8 bytes)
+; LiveOut Entry 1: %RSP (8 bytes)
; STACK-NEXT: .short 7
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 8
@@ -122,13 +156,19 @@ entry:
; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16
+; Align
+; STACK-NEXT: .align 3
; StackMap 3 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0
+; Padding
+; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0
+; Align
+; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 3, i32 5)
call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
ret void
@@ -141,39 +181,58 @@ entry:
; STACK-LABEL: .long L{{.*}}-_mixed_liveness
; STACK-NEXT: .short 0
; STACK-NEXT: .short 0
+; Padding
+; STACK-NEXT: .short 0
; Num LiveOut Entries: 1
; STACK-NEXT: .short 1
; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2
; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16
+; Align
+; STACK-NEXT: .align 3
+
+
; StackMap 5 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_mixed_liveness
; STACK-NEXT: .short 0
; STACK-NEXT: .short 0
+; Padding
+; STACK-NEXT: .short 0
; Num LiveOut Entries: 0
; STACK-NEXT: .short 0
+; Align
+; STACK-NEXT: .align 3
; StackMap 4 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0
+; Padding
+; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0
+; Align
+; PATCH-NEXT: .align 3
+
; StackMap 5 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0
+; Padding
+; PATCH-NEXT: .short 0
; Num LiveOut Entries: 2
; PATCH-NEXT: .short 2
; LiveOut Entry 1: %RSP (8 bytes)
; PATCH-NEXT: .short 7
; PATCH-NEXT: .byte 0
; PATCH-NEXT: .byte 8
-; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2
+; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
; PATCH-NEXT: .short 19
; PATCH-NEXT: .byte 0
; PATCH-NEXT: .byte 16
+; Align
+; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 4, i32 5)
call anyregcc void (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.void(i64 5, i32 0, i8* null, i32 0)
call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
diff --git a/test/CodeGen/X86/stackmap.ll b/test/CodeGen/X86/stackmap.ll
index 2b7bb18..b827cbb 100644
--- a/test/CodeGen/X86/stackmap.ll
+++ b/test/CodeGen/X86/stackmap.ll
@@ -4,45 +4,51 @@
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps:
+; Header
; CHECK-NEXT: .long 0
; Num Functions
; CHECK-NEXT: .long 15
-; CHECK-NEXT: .long _constantargs
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _osrinline
-; CHECK-NEXT: .long 24
-; CHECK-NEXT: .long _osrcold
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _propertyRead
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _propertyWrite
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _jsVoidCall
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _jsIntCall
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _spilledValue
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _spilledStackMapValue
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _spillSubReg
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _subRegOffset
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _liveConstant
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _directFrameIdx
-; CHECK-NEXT: .long 56
-; CHECK-NEXT: .long _longid
-; CHECK-NEXT: .long 8
-; CHECK-NEXT: .long _clobberScratch
-; CHECK-NEXT: .long 56
; Num LargeConstants
-; CHECK-NEXT: .long 3
+; CHECK-NEXT: .long 3
+; Num Callsites
+; CHECK-NEXT: .long 19
+
+; Functions and stack size
+; CHECK-NEXT: .quad _constantargs
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _osrinline
+; CHECK-NEXT: .quad 24
+; CHECK-NEXT: .quad _osrcold
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _propertyRead
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _propertyWrite
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _jsVoidCall
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _jsIntCall
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _spilledValue
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _spilledStackMapValue
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _spillSubReg
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _subRegOffset
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _liveConstant
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _directFrameIdx
+; CHECK-NEXT: .quad 56
+; CHECK-NEXT: .quad _longid
+; CHECK-NEXT: .quad 8
+; CHECK-NEXT: .quad _clobberScratch
+; CHECK-NEXT: .quad 56
+
+; Large Constants
; CHECK-NEXT: .quad 2147483648
; CHECK-NEXT: .quad 4294967295
; CHECK-NEXT: .quad 4294967296
-; Num Callsites
-; CHECK-NEXT: .long 19
+; Callsites
; Constant arguments
;
; CHECK-NEXT: .quad 1
--
1.8.5.3
BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignTrailingComments: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
BreakBeforeBraces: Attach
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
IndentCaseLabels: true
IndentWidth: 4
Language: Cpp
MaxEmptyLinesToKeep: 3
NamespaceIndentation: None
PointerBindsToType: true
SpaceBeforeParens: ControlStatements
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
Standard: Cpp03
TabWidth: 4
UseTab: Never
# Unset settings are undecided
......@@ -305,6 +305,12 @@ define checksha
test "$$($1 | sha1sum)" = "$2 -"
endef
.PHONY: format check_format
format:
find \( -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 $(LLVM_BIN)/clang-format -style=file -i
check_format:
$(TOOLS_DIR)/check_format.sh $(LLVM_BIN)/clang-format
.PHONY: test test_debug test_prof test_release
test_debug: pyston_dbg ext
python ../tools/tester.py -j$(TEST_THREADS) -k $(TESTS_DIR) $(ARGS)
......
#!/bin/bash
set -eu
for fn in $(find -name '*.cpp' -o -name '*.h'); do
$1 -style=file -output-replacements-xml $fn | grep -q "replacement offset" && { echo $fn "failed clang-format check"; exit 1; }
done
echo "Format checks passed"
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment