Skip to content

Instantly share code, notes, and snippets.

View dougpuob's full-sized avatar
:octocat:

Douglas Chen dougpuob

:octocat:
View GitHub Profile
@dougpuob
dougpuob / windows-docker-daemon.json
Last active October 31, 2021 03:08
Setup DevOps environment
# C:\ProgramData\Docker\config\daemon.json
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": true,
"experimental": false,
"exec-opts": [
"isolation=process"
@dougpuob
dougpuob / .md
Last active April 4, 2021 23:58
llvmorg-11.1.0-patch

Change#1 (Remove)

./llvm-project.git/lib/cmake/clang/ClangConfig.cmake

set(CLANG_EXPORTED_TARGETS "clangBasic;clangLex;clangParse;clangAST;clangDynamicASTMatchers;clangASTMatchers;clangCrossTU;clangSema;clangCodeGen;clangAnalysis;clangEdit;clangRewrite;clangARCMigrate;clangDriver;clangSerialization;clangRewriteFrontend;clangFrontend;clangFrontendTool;clangToolingCore;clangToolingInclusions;clangToolingRefactoring;clangToolingASTDiff;clangToolingSyntax;clangDependencyScanning;clangTransformer;clangTooling;clangDirectoryWatcher;clangIndex;clangStaticAnalyzerCore;clangStaticAnalyzerCheckers;clangStaticAnalyzerFrontend;clangFormat;clangTesting; diagtool;clang;clang-format;clangHandleCXX;clangHandleLLVM;clang-offload-bundler;clang-offload-wrapper;clang-scan-deps;clang-rename;clang-refactor;clang-check;clang-extdef-mapping; libclang")


Change#2 (Remark)

/// AST_MATCHER_P(Type, DefineMatcher, ParamType, Param) { ... }
/// defines a single-parameter function named DefineMatcher() that returns a
/// Matcher<Type> object.
///
/// The code between the curly braces has access to the following variables:
///
/// Node: the AST node being matched; its type is Type.
/// Param: the parameter passed to the function; its type
/// is ParamType.
// [Repo] https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strncpy.c
// [Local] C:\petzone\reference\gcc\gcc.git\gcc\testsuite\gcc.c-torture\execute\builtins\lib\strncpy.c
extern void abort(void);
extern int inside_main;
typedef __SIZE_TYPE__ size_t;
__attribute__ ((__noinline__))
char *
// /home/dougpuob/petzone/llvm/llvm-project.git/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp
//===-- sanitizer_libc.cpp ------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\atlmfc\include\atlutil.h
inline char * __cdecl _strncpy(
_Out_writes_z_(count) char * dest,
_In_reads_z_(count) const char * source,
_In_ size_t count) throw()
{
ATLASSERT( dest != NULL );
ATLASSERT( source != NULL );
if(!dest || count==0)
{
PS C:\petzone\llvm\llvm-project.git\build-debug\Debug\bin> .\clang-tidy.exe ..\..\..\..\sample.cpp
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "..\..\..\..\sample.cpp"
No compilation database found in C:\petzone\llvm\llvm-project.git\build-debug\Debug\bin\..\..\..\.. or any parent directory
fixed-compilation-database: Error while opening fixed database: no such file or directory
json-compilation-database: Error while opening JSON database: no such file or directory
Running without flags.
getDeclTypeNameByClangApi() TypeName=int
getDeclTypeNameByManualParsing() TypeName=int
-------------------------------------------------------------------------
@dougpuob
dougpuob / README.txt
Last active September 10, 2020 02:33
llvm-project.git--build-*.ps1
**我用來 build llvm-project.git 的 PowerShell script files**
build-windows-msvc2019-relwithdebinfo.ps1
from random import randint
from asciimatics.screen import Screen
def demo(screen):
while True:
screen.print_at('Hello world!',
randint(0, screen.width), randint(0, screen.height),
colour=randint(0, screen.colours - 1),
bg=randint(0, screen.colours - 1))
ev = screen.get_key()
@dougpuob
dougpuob / [CodeReview] _ZipZipMgr_CalcLocalFileEntrySize().c
Last active July 27, 2017 06:24
[CodeReview] _ZipZipMgr_CalcLocalFileEntrySize()
// -------------------------------------------------------------------------------------------
// Original
// -------------------------------------------------------------------------------------------
static
size_t
_ZipZipMgr_CalcLocalFileEntrySize(
IN ZIPMGR_MODULE* pThis,
IN ZIPMGR_LOCAL_FILE_ENTRY* pLocalFileEntry
)
{