Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
/ libcxx Public archive

Commit

Permalink
Upstream to LLVM 15
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Aug 19, 2022
1 parent 9b40e8b commit 82090ae
Show file tree
Hide file tree
Showing 8,304 changed files with 465,107 additions and 220,916 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
82 changes: 79 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,13 +1,89 @@
BasedOnStyle: LLVM

---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignEscapedNewlines: Right
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: true
AllowShortLambdasOnASingleLine: All
AttributeMacros: ['_LIBCPP_HIDE_FROM_ABI',
'_LIBCPP_CONSTEXPR',
'_LIBCPP_CONSTEXPR_AFTER_CXX11',
'_LIBCPP_CONSTEXPR_AFTER_CXX14',
'_LIBCPP_CONSTEXPR_AFTER_CXX17',
'_LIBCPP_CONSTEXPR_AFTER_CXX20',
'_LIBCPP_ALIGNOF',
'_ALIGNAS_TYPE',
'_ALIGNAS',
'_LIBCPP_NORETURN',
'_LIBCPP_ALWAYS_INLINE',
'_LIBCPP_DISABLE_EXTENTSION_WARNING',
'_LIBCPP_HIDDEN',
'_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS',
'_LIBCPP_FUNC_VIS',
'_LIBCPP_TYPE_VIS',
'_LIBCPP_TEMPLATE_VIS',
'_LIBCPP_TEMPLATE_DATA_VIS',
'_LIBCPP_EXPORTED_FROM_ABI',
'_LIBCPP_OVERRIDABLE_FUNC_VIS',
'_LIBCPP_EXCEPTION_ABI',
'_LIBCPP_ENUM_VIS',
'_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS',
'_LIBCPP_INTERNAL_LINKAGE',
'_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
'_LIBCPP_HIDE_FROM_ABI_AFTER_V1',
'_LIBCPP_INLINE_VISIBILITY',
'_LIBCPP_CONSTEVAL',
'_LIBCPP_NOALIAS',
'_LIBCPP_USING_IF_EXISTS',
'_LIBCPP_DEPRECATED',
'_LIBCPP_DEPRECATED_IN_CXX11',
'_LIBCPP_DEPRECATED_IN_CXX14',
'_LIBCPP_DEPRECATED_IN_CXX17',
'_LIBCPP_DEPRECATED_IN_CXX20',
'_LIBCPP_NODISCARD',
'_LIBCPP_NODISCARD_EXT',
'_LIBCPP_NO_DESTROY',
'_LIBCPP_WEAK',
'_LIBCPP_CONSTINIT',
'_LIBCPP_FALLTHROUGH',
'_LIBCPP_STANDALONE_DEBUG',
'_LIBCPP_NO_UNIQUE_ADDRESS',
]
BinPackArguments: false
BinPackParameters: false
BreakBeforeConceptDeclarations: true
BreakInheritanceList: BeforeColon
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
IndentWrappedFunctionNames: false
IndentRequires: true
InsertTrailingCommas: Wrapped
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
PackConstructorInitializers: NextLine

PenaltyIndentedWhitespace: 2

Language: Cpp
Standard: Cpp03
Standard: c++20
SpacesInAngles: Leave

AlwaysBreakTemplateDeclarations: true
PointerAlignment: Left


# Disable formatting options which may break tests.
SortIncludes: false
ReflowComments: false
---

# libc++'s preferred indentions of preprocessor statements.
IndentPPDirectives: AfterHash

# libc++ has some long names so we need more than the 80 column limit imposed by LLVM style, for sensible formatting
ColumnLimit: 120
60 changes: 60 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Checks: >
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-infinite-loop,
bugprone-stringview-nullptr,
bugprone-use-after-move,
llvm-include-order,
llvm-namespace-comment,
misc-definitions-in-headers,
misc-misplaced-const,
misc-non-copyable-objects,
misc-uniqueptr-reset-release,
modernize-loop-convert,
modernize-redundant-void-arg,
readability-duplicate-include,
readability-identifier-naming,
readability-function-cognitive-complexity,
readability-function-size,
readability-misplaced-array-index,
readability-redundant-control-flow,
readability-redundant-function-ptr-dereference,
readability-redundant-preprocessor,
readability-simplify-subscript-expr,
readability-uniqueptr-delete-release,
CheckOptions:
- key: readability-function-cognitive-complexity.Threshold
value: 143 # TODO: bring that number down
- key: readability-function-size.LineThreshold
value: 194 # TODO: bring that number down
- key: readability-identifier-naming.GetConfigPerFile
value: false
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.ParameterPrefix
value: __

# TODO: investigate these checks
# bugprone-branch-clone,
# bugprone-macro-parentheses,
# cppcoreguidelines-prefer-member-initializer,
# misc-unused-parameters,
# modernize-use-bool-literals,
# modernize-use-default-member-init,
# modernize-use-equals-default,
# modernize-use-equals-delete,
# modernize-use-nullptr,
# modernize-use-override,
# portability-restrict-system-includes,
# readability-function-cognitive-complexity,
# readability-implicit-bool-conversion,
# readability-isolate-declaration,
# readability-redundant-access-specifiers,
# readability-redundant-declaration,
# readability-redundant-member-init,
# readability-simplify-boolean-expr,
10 changes: 7 additions & 3 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
LOCAL_PATH := $(call my-dir)

# libcxx defines
libcxx_includes := $(LOCAL_PATH)/include
libcxx_includes := $(LOCAL_PATH)/include $(LOCAL_PATH)/src
libcxx_export_includes := $(libcxx_includes)
libcxx_sources := \
algorithm.cpp \
Expand All @@ -25,13 +25,17 @@ libcxx_sources := \
future.cpp \
hash.cpp \
ios.cpp \
ios.instantiations.cpp \
iostream.cpp \
legacy_debug_handler.cpp \
legacy_pointer_safety.cpp \
locale.cpp \
memory.cpp \
mutex.cpp \
mutex_destructor.cpp \
new.cpp \
optional.cpp \
random_shuffle.cpp \
random.cpp \
regex.cpp \
shared_mutex.cpp \
Expand All @@ -45,13 +49,14 @@ libcxx_sources := \
valarray.cpp \
variant.cpp \
vector.cpp \
verbose_abort.cpp \

libcxx_sources := $(libcxx_sources:%=src/%)

libcxx_export_cxxflags :=

libcxx_cxxflags := \
-std=c++1z \
-std=c++20 \
-fvisibility-global-new-delete-hidden \
-fvisibility=hidden -fvisibility-inlines-hidden \
-DLIBCXX_BUILDING_LIBCXXABI \
Expand All @@ -76,7 +81,6 @@ libcxxabi_src_files := \
cxa_handlers.cpp \
cxa_noexception.cpp \
cxa_thread_atexit.cpp \
cxa_unexpected.cpp \
cxa_vector.cpp \
cxa_virtual.cpp \
stdlib_exception.cpp \
Expand Down

0 comments on commit 82090ae

Please sign in to comment.