repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/runner.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module is responsible to run the analyzer commands. """
import re
import os
import os.path
import tempfile
import fun... | 11,337 | 36.419142 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/report.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module is responsible to generate 'index.html' for the report.
The input for this step is the output directory, where... | 18,471 | 33.334572 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/compilation.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module is responsible for to parse a compiler invocation. """
import re
import os
import collections
__all__ = ['spl... | 4,649 | 31.746479 | 76 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/__init__.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
"""
This module responsible to run the Clang static analyzer against any build
and generate reports.
"""
def duplicate_check(... | 2,487 | 28.975904 | 77 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/analyze.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module implements the 'scan-build' command API.
To run the static analyzer against a build is done in multiple steps:... | 20,779 | 39.193424 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/clang/enumerations.py | #===- enumerations.py - Python Enumerations ------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 1,077 | 29.8 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py | #===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 116,776 | 28.86624 | 86 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/clang/__init__.py | #===- __init__.py - Clang Python Bindings --------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 826 | 24.060606 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/examples/cindex/cindex-includes.py | #!/usr/bin/env python
#===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===---------------------------------------... | 1,644 | 26.881356 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/examples/cindex/cindex-dump.py | #!/usr/bin/env python
#===- cindex-dump.py - cindex/Python Source Dump -------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===---------------------------------------... | 2,733 | 30.068182 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/__init__.py | 0 | 0 | 0 | py | |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_code_completion.py | from clang.cindex import TranslationUnit
def check_completion_results(cr, expected):
assert cr is not None
assert len(cr.diagnostics) == 0
completions = [str(c) for c in cr.results]
for c in expected:
assert c in completions
def test_code_complete():
files = [('fake.c', """
/// Aaa.
int ... | 2,766 | 35.407895 | 191 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_translation_unit.py | import gc
import os
import tempfile
from clang.cindex import CursorKind
from clang.cindex import Cursor
from clang.cindex import File
from clang.cindex import Index
from clang.cindex import SourceLocation
from clang.cindex import SourceRange
from clang.cindex import TranslationUnitSaveError
from clang.cindex import Tr... | 7,064 | 27.035714 | 81 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_index.py | from clang.cindex import *
import os
kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS')
def test_create():
index = Index.create()
# FIXME: test Index.read
def test_parse():
index = Index.create()
assert isinstance(index, Index)
tu = index.parse(os.path.join(kInputsDir, 'hello.cpp'))
... | 359 | 21.5 | 62 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_token_kind.py | from clang.cindex import TokenKind
from nose.tools import eq_
from nose.tools import ok_
from nose.tools import raises
def test_constructor():
"""Ensure TokenKind constructor works as expected."""
t = TokenKind(5, 'foo')
eq_(t.value, 5)
eq_(t.name, 'foo')
@raises(ValueError)
def test_bad_register():... | 1,064 | 23.204545 | 69 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_diagnostics.py | from clang.cindex import *
from .util import get_tu
# FIXME: We need support for invalid translation units to test better.
def test_diagnostic_warning():
tu = get_tu('int f0() {}\n')
assert len(tu.diagnostics) == 1
assert tu.diagnostics[0].severity == Diagnostic.Warning
assert tu.diagnostics[0].locati... | 3,693 | 37.884211 | 75 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_cursor.py | import ctypes
import gc
from clang.cindex import CursorKind
from clang.cindex import TemplateArgumentKind
from clang.cindex import TranslationUnit
from clang.cindex import TypeKind
from .util import get_cursor
from .util import get_cursors
from .util import get_tu
kInput = """\
struct s0 {
int a;
int b;
};
struc... | 13,365 | 28.375824 | 93 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_cdb.py | from clang.cindex import CompilationDatabase
from clang.cindex import CompilationDatabaseError
from clang.cindex import CompileCommands
from clang.cindex import CompileCommand
import os
import gc
kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS')
def test_create_fail():
"""Check we fail loading a data... | 4,586 | 37.872881 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_type.py | import gc
from clang.cindex import CursorKind
from clang.cindex import TranslationUnit
from clang.cindex import TypeKind
from nose.tools import raises
from .util import get_cursor
from .util import get_tu
kInput = """\
typedef int I;
struct teststruct {
int a;
I b;
long c;
unsigned long d;
signed long e;
... | 11,981 | 28.439803 | 88 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_access_specifiers.py |
from clang.cindex import AccessSpecifier
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
from .util import get_cursor
from .util import get_tu
def test_access_specifiers():
"""Ensure that C++ access specifiers are available on cursors"""
tu = get_tu("""
class test_class {
public:
... | 963 | 26.542857 | 68 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/util.py | # This file provides common utility functions for the test suite.
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
def get_tu(source, lang='c', all_warnings=False, flags=[]):
"""Obtain a translation unit from source and language.
By default, the translation unit is created from source... | 2,293 | 29.184211 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_cursor_kind.py | from clang.cindex import CursorKind
def test_name():
assert CursorKind.UNEXPOSED_DECL.name is 'UNEXPOSED_DECL'
def test_get_all_kinds():
kinds = CursorKind.get_all_kinds()
assert CursorKind.UNEXPOSED_DECL in kinds
assert CursorKind.TRANSLATION_UNIT in kinds
assert CursorKind.VARIABLE_REF in kinds
... | 1,924 | 37.5 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/__init__.py | 0 | 0 | 0 | py | |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_file.py | from clang.cindex import Index, File
def test_file():
index = Index.create()
tu = index.parse('t.c', unsaved_files = [('t.c', "")])
file = File.from_name(tu, "t.c")
assert str(file) == "t.c"
assert file.name == "t.c"
assert repr(file) == "<File: t.c>"
| 265 | 25.6 | 56 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_comment.py | from clang.cindex import TranslationUnit
from tests.cindex.util import get_cursor
def test_comment():
files = [('fake.c', """
/// Aaa.
int test1;
/// Bbb.
/// x
void test2(void);
void f() {
}
""")]
# make a comment-aware TU
tu = TranslationUnit.from_source('fake.c', ['-std=c99'], unsaved_files=files,
... | 957 | 22.365854 | 84 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_location.py | from clang.cindex import Cursor
from clang.cindex import File
from clang.cindex import SourceLocation
from clang.cindex import SourceRange
from .util import get_cursor
from .util import get_tu
baseInput="int one;\nint two;\n"
def assert_location(loc, line, column, offset):
assert loc.line == line
assert loc.c... | 3,153 | 31.854167 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/bindings/python/tests/cindex/test_tokens.py | from clang.cindex import CursorKind
from clang.cindex import Index
from clang.cindex import SourceLocation
from clang.cindex import SourceRange
from clang.cindex import TokenKind
from nose.tools import eq_
from nose.tools import ok_
from .util import get_tu
def test_token_to_cursor():
"""Ensure we can obtain a Cu... | 1,384 | 25.132075 | 62 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/www/builtins.py | #!/usr/bin/env python
import sys, fileinput
err=0
# Giant associative set of builtin->intrinsic mappings where clang doesn't
# implement the builtin since the vector operation works by default.
repl_map = {
'__builtin_ia32_addps': '_mm_add_ps',
'__builtin_ia32_addsd': '_mm_add_sd',
'__builtin_ia32_addpd': '_mm_add_... | 6,633 | 39.45122 | 132 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/docs/conf.py | # -*- coding: utf-8 -*-
#
# Clang documentation build configuration file, created by
# sphinx-quickstart on Sun Dec 9 20:01:55 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 9,128 | 32.317518 | 83 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/docs/tools/dump_format_style.py | #!/usr/bin/env python
# A tool to parse the FormatStyle struct from Format.h and update the
# documentation in ../ClangFormatStyleOptions.rst automatically.
# Run from the directory in which this file is located to update the docs.
import collections
import os
import re
import urllib2
CLANG_DIR = os.path.join(os.path... | 6,350 | 30.755 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/docs/tools/dump_ast_matchers.py | #!/usr/bin/env python
# A tool to parse ASTMatchers.h and update the documentation in
# ../LibASTMatchersReference.html automatically. Run from the
# directory in which this file is located to update the docs.
import collections
import re
import urllib2
MATCHERS_FILE = '../../include/clang/ASTMatchers/ASTMatchers.h'
... | 14,497 | 36.657143 | 129 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/docs/analyzer/conf.py | # -*- coding: utf-8 -*-
#
# Clang Static Analyzer documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 2 15:54:28 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated... | 8,070 | 31.544355 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/modfuzz.py | #! /usr/bin/env python
# To use:
# 1) Update the 'decls' list below with your fuzzing configuration.
# 2) Run with the clang binary as the command-line argument.
import random
import subprocess
import sys
import os
clang = sys.argv[1]
none_opts = 0.3
class Decl:
def __init__(self, text, depends=[], provides=[],... | 3,777 | 21.622754 | 103 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/token-delta.py | #!/usr/bin/env python
import os
import re
import subprocess
import sys
import tempfile
###
class DeltaAlgorithm(object):
def __init__(self):
self.cache = set()
def test(self, changes):
abstract
###
def getTestResult(self, changes):
# There is no reason to cache successful t... | 8,168 | 31.416667 | 94 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/ClangDataFormat.py | """lldb data formatters for clang classes.
Usage
--
import this file in your ~/.lldbinit by adding this line:
command script import /path/to/ClangDataFormat.py
After that, instead of getting this:
(lldb) p Tok.Loc
(clang::SourceLocation) $0 = {
(unsigned int) ID = 123582
}
you'll get:
(lldb) p Tok.Loc
(clang::S... | 5,012 | 29.944444 | 172 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/ABITest/ABITestGen.py | #!/usr/bin/env python
from pprint import pprint
import random, atexit, time
from random import randrange
import re
from Enumeration import *
from TypeGen import *
####
class TypePrinter:
def __init__(self, output, outputHeader=None,
outputTests=None, outputDriver=None,
headerN... | 30,083 | 43.701337 | 170 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/ABITest/Enumeration.py | """Utilities for enumeration of finite and countably infinite sets.
"""
###
# Countable iteration
# Simplifies some calculations
class Aleph0(int):
_singleton = None
def __new__(type):
if type._singleton is None:
type._singleton = int.__new__(type)
return type._singleton
def __r... | 7,814 | 27.212996 | 93 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/ABITest/TypeGen.py | """Flexible enumeration of C types."""
from Enumeration import *
# TODO:
# - struct improvements (flexible arrays, packed &
# unpacked, alignment)
# - objective-c qualified id
# - anonymous / transparent unions
# - VLAs
# - block types
# - K&R functions
# - pass arguments of different types (test extension... | 14,959 | 30.428571 | 91 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/CIndex/completion_logger_server.py | #!/usr/bin/env python
import sys
from socket import *
from time import strftime
import datetime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# ... | 1,004 | 21.333333 | 99 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/check_cfc/obj_diff.py | #!/usr/bin/env python2.7
from __future__ import print_function
import argparse
import difflib
import filecmp
import os
import subprocess
import sys
disassembler = 'objdump'
def keep_line(line):
"""Returns true for lines that should be compared in the disassembly
output."""
return "file format" not in li... | 3,559 | 32.584906 | 114 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/check_cfc/setup.py | """For use on Windows. Run with:
python.exe setup.py py2exe
"""
from distutils.core import setup
try:
import py2exe
except ImportError:
import platform
import sys
if platform.system() == 'Windows':
print "Could not find py2exe. Please install then run setup.py py2exe."
raise
... | 520 | 22.681818 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/check_cfc/test_check_cfc.py | #!/usr/bin/env python2.7
"""Test internal functions within check_cfc.py."""
import check_cfc
import os
import platform
import unittest
class TestCheckCFC(unittest.TestCase):
def test_flip_dash_g(self):
self.assertIn('-g', check_cfc.flip_dash_g(['clang', '-c']))
self.assertNotIn('-g', check_cfc.... | 7,480 | 43.266272 | 86 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/check_cfc/check_cfc.py | #!/usr/bin/env python2.7
"""Check CFC - Check Compile Flow Consistency
This is a compiler wrapper for testing that code generation is consistent with
different compilation processes. It checks that code is not unduly affected by
compiler options or other changes which should not have side effects.
To use:
-Ensure th... | 14,547 | 35.099256 | 91 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/analyzer/SumTimerInfo.py | #!/usr/bin/env python
"""
Script to Summarize statistics in the scan-build output.
Statistics are enabled by passing '-internal-stats' option to scan-build
(or '-analyzer-stats' to the analyzer).
"""
import string
from operator import itemgetter
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
... | 3,095 | 35.857143 | 114 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/analyzer/CmpRuns.py | #!/usr/bin/env python
"""
CmpRuns - A simple tool for comparing two static analyzer runs to determine
which reports have been added, removed, or changed.
This is designed to support automated testing using the static analyzer, from
two perspectives:
1. To monitor changes in the static analyzer's reports on real cod... | 11,083 | 32.68997 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/analyzer/SATestAdd.py | #!/usr/bin/env python
"""
Static Analyzer qualification infrastructure: adding a new project to
the Repository Directory.
Add a new project for testing: build it and add to the Project Map file.
Assumes it's being run from the Repository Directory.
The project directory should be added inside the Repository Di... | 4,793 | 43.803738 | 81 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/analyzer/SATestBuild.py | #!/usr/bin/env python
"""
Static Analyzer qualification infrastructure.
The goal is to test the analyzer against different projects, check for failures,
compare results, and measure performance.
Repository Directory will contain sources of the projects as well as the
information on how to build them and the expected... | 26,878 | 35.921703 | 122 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/perf-training/perf-helper.py | #===- perf-helper.py - Clang Python Bindings -----------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 14,154 | 33.608802 | 85 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/clang/utils/TestUtils/deep-stack.py | #!/usr/bin/env python
def pcall(f, N):
if N == 0:
print >>f, ' f(0)'
return
print >>f, ' f('
pcall(f, N - 1)
print >>f, ' )'
def main():
f = open('t.c','w')
print >>f, 'int f(int n) { return n; }'
print >>f, 'int t() {'
print >>f, ' return'
pcall(f, 1000... | 451 | 17.08 | 43 | py |
LowFat | LowFat-master/llvm-4.0.0.src/tools/sancov/coverage-report-server.py | #!/usr/bin/env python3
#===- symcov-report-server.py - Coverage Reports HTTP Serve --*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===---------------------------------------... | 6,519 | 30.960784 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/enumerations.py | #===- enumerations.py - Python LLVM Enumerations -------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 4,249 | 19.04717 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/core.py | #===- core.py - Python LLVM Bindings -------------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 18,523 | 28.54386 | 84 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/object.py | #===- object.py - Python Object Bindings --------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===---------------------------------------------------------------... | 16,015 | 30.403922 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/bit_reader.py |
from .common import LLVMObject
from .common import c_object_p
from .common import get_library
from . import enumerations
from .core import MemoryBuffer
from .core import Module
from .core import OpCode
from ctypes import POINTER
from ctypes import byref
from ctypes import c_char_p
from ctypes import cast
__all__ = ['p... | 815 | 25.322581 | 76 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/common.py | #===- common.py - Python LLVM Bindings -----------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 3,884 | 29.590551 | 86 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/__init__.py | 0 | 0 | 0 | py | |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/disassembler.py | #===- disassembler.py - Python LLVM Bindings -----------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | 5,889 | 33.444444 | 122 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/tests/base.py | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/usr/lib/debug',
'/lib',
'/usr/lib',
'/usr/local/lib',
'/lib/i386-linux-gnu',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""... | 1,016 | 25.076923 | 84 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/tests/test_core.py | from .base import TestBase
from ..core import MemoryBuffer
from ..core import PassRegistry
from ..core import Context
from ..core import Module
from ..core import Enums
from ..core import OpCode
from ..bit_reader import parse_bitcode
class TestCore(TestBase):
def test_enumerations(self):
for enum_cls, enum... | 4,675 | 32.163121 | 131 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/tests/test_object.py | from .base import TestBase
from ..object import ObjectFile
from ..object import Relocation
from ..object import Section
from ..object import Symbol
class TestObjectFile(TestBase):
def get_object_file(self):
source = self.get_test_binary()
return ObjectFile(filename=source)
def test_create_from... | 2,143 | 30.529412 | 63 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/tests/test_disassembler.py | from .base import TestBase
from ..disassembler import Disassembler, Option_UseMarkup
class TestDisassembler(TestBase):
def test_instantiate(self):
Disassembler('i686-apple-darwin9')
def test_basic(self):
sequence = '\x67\xe3\x81' # jcxz -127
triple = 'i686-apple-darwin9'
dis... | 1,475 | 32.545455 | 92 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/tests/test_bitreader.py | from .base import TestBase
from ..core import OpCode
from ..core import MemoryBuffer
from ..core import PassRegistry
from ..core import Context
from ..core import Module
from ..bit_reader import parse_bitcode
class TestBitReader(TestBase):
def test_parse_bitcode(self):
source = self.get_test_bc()
... | 419 | 25.25 | 56 | py |
LowFat | LowFat-master/llvm-4.0.0.src/bindings/python/llvm/tests/__init__.py | 0 | 0 | 0 | py | |
LowFat | LowFat-master/llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/complete/split-lib.py | #!/usr/bin/env python
class TimingScriptGenerator:
"""Used to generate a bash script which will invoke the toy and time it"""
def __init__(self, scriptname, outputname):
self.shfile = open(scriptname, 'w')
self.timeFile = outputname
self.shfile.write("echo \"\" > %s\n" % self.timeFile)
... | 3,805 | 52.605634 | 208 | py |
LowFat | LowFat-master/llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/complete/genk-timing.py | #!/usr/bin/env python
import sys
import random
class TimingScriptGenerator:
"""Used to generate a bash script which will invoke the toy and time it"""
def __init__(self, scriptname, outputname):
self.timeFile = outputname
self.shfile = open(scriptname, 'w')
self.shfile.write("echo \"\"... | 11,103 | 48.351111 | 179 | py |
LowFat | LowFat-master/llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | #!/usr/bin/env python
import sys
import random
class TimingScriptGenerator:
"""Used to generate a bash script which will invoke the toy and time it"""
def __init__(self, scriptname, outputname):
self.timeFile = outputname
self.shfile = open(scriptname, 'w')
self.shfile.write("echo \"\"... | 10,499 | 46.727273 | 147 | py |
LowFat | LowFat-master/llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/cached/split-lib.py | #!/usr/bin/env python
class TimingScriptGenerator:
"""Used to generate a bash script which will invoke the toy and time it"""
def __init__(self, scriptname, outputname):
self.shfile = open(scriptname, 'w')
self.timeFile = outputname
self.shfile.write("echo \"\" > %s\n" % self.timeFile)
... | 3,622 | 50.028169 | 150 | py |
LowFat | LowFat-master/llvm-4.0.0.src/examples/Kaleidoscope/MCJIT/cached/genk-timing.py | #!/usr/bin/env python
import sys
import random
class TimingScriptGenerator:
"""Used to generate a bash script which will invoke the toy and time it"""
def __init__(self, scriptname, outputname):
self.timeFile = outputname
self.shfile = open(scriptname, 'w')
self.shfile.write("echo \"\"... | 10,499 | 46.727273 | 147 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/test/asan/android_commands/android_compile.py | #!/usr/bin/python
import os, sys, subprocess
from android_common import *
here = os.path.abspath(os.path.dirname(sys.argv[0]))
android_run = os.path.join(here, 'android_run.py')
output = None
output_type = 'executable'
args = sys.argv[1:]
while args:
arg = args.pop(0)
if arg == '-shared':
output_ty... | 756 | 19.459459 | 52 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/test/asan/android_commands/android_run.py | #!/usr/bin/python
import os, signal, sys, subprocess, tempfile
from android_common import *
ANDROID_TMPDIR = '/data/local/tmp/Output'
here = os.path.abspath(os.path.dirname(sys.argv[0]))
device_binary = os.path.join(ANDROID_TMPDIR, os.path.basename(sys.argv[0]))
def build_env():
args = []
# Android linker i... | 1,545 | 35.809524 | 90 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/test/asan/android_commands/android_common.py | import os, subprocess, tempfile
import time
ANDROID_TMPDIR = '/data/local/tmp/Output'
ADB = os.environ.get('ADB', 'adb')
verbose = False
if os.environ.get('ANDROID_RUN_VERBOSE') == '1':
verbose = True
def adb(args, attempts = 1):
if verbose:
print args
tmpname = tempfile.mktemp()
out = open(t... | 1,193 | 25.533333 | 79 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py | #!/usr/bin/env python
#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | 18,097 | 34.073643 | 95 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/litlint_test.py | #!/usr/bin/python
# Tests for litlint.py
#
# Usage: python litlint_test.py
#
# Returns nonzero if any test fails
import litlint
import unittest
class TestLintLine(unittest.TestCase):
def test_missing_run(self):
f = litlint.LintLine
self.assertEqual(f(' %t '), ('missing %run before %t', 2))
self.ass... | 621 | 24.916667 | 66 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py | #!/usr/bin/env python
# Merge or print the coverage data collected by asan's coverage.
# Input files are sequences of 4-byte integers.
# We need to merge these integers into a set and then
# either print them (as hex) or dump them into another file.
import array
import bisect
import glob
import os.path
import struct
im... | 8,087 | 31.744939 | 112 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | #!/usr/bin/env python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 158,908 | 38.480497 | 86 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/litlint.py | #!/usr/bin/env python
#
# litlint
#
# Ensure RUN commands in lit tests are free of common errors.
#
# If any errors are detected, litlint returns a nonzero exit code.
#
import optparse
import re
import sys
# Compile regex once for all files
runRegex = re.compile(r'(?<!-o)(?<!%run) %t\s')
def LintLine(s):
""" Valid... | 1,529 | 19.958904 | 72 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py | #!/usr/bin/env python
#===- lib/sanitizer_common/scripts/gen_dynamic_list.py ---------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | 4,250 | 36.619469 | 99 | py |
LowFat | LowFat-master/llvm-4.0.0.src/projects/compiler-rt/lib/dfsan/scripts/build-libc-list.py | #!/usr/bin/env python
#===- lib/dfsan/scripts/build-libc-list.py ---------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | 3,335 | 33.391753 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/tools/llvm-readobj/Inputs/relocs.py | #!/usr/bin/env python
# Generates ELF, COFF and MachO object files for different architectures
# containing all relocations:
#
# ELF: i386, x86_64, ppc64, aarch64, arm, mips, mips64el
# COFF: i386, x86_64
# MachO: i386, x86_64, arm
# (see end of file for triples)
#
# To simplify generation, object files are generat... | 41,252 | 32.897288 | 128 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/Other/opt-bisect-helper.py | #!/usr/bin/env python
import os
import sys
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('--start', type=int, default=0)
parser.add_argument('--end', type=int, default=(1 << 32))
parser.add_argument('--optcmd', default=("opt"))
parser.add_argument('--filecheckcmd', default=... | 1,234 | 29.875 | 86 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/MC/COFF/bigobj.py | # RUN: python %s | llvm-mc -filetype=obj -triple i686-pc-win32 - | llvm-readobj -h | FileCheck %s
# This test checks that the COFF object emitter can produce objects with
# more than 65279 sections.
# While we only generate 65277 sections, an implicit .text, .data and .bss will
# also be emitted. This brings the tot... | 896 | 32.222222 | 97 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/BugPoint/compile-custom.ll.py | #!/usr/bin/env python
import sys
# Currently any print-out from the custom tool is interpreted as a crash
# (i.e. test is still interesting)
print("Error: " + ' '.join(sys.argv[1:]))
sys.exit(1)
| 199 | 17.181818 | 72 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/spill-01.py | # Test cases where MVC is used for spill slots that end up being out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# There are 8 usable call-saved GPRs, two of which are needed for the base
# registers. The first 160 bytes of the frame are needed for the ABI
# call frame, and a further 8 by... | 1,256 | 29.658537 | 84 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-12.py | # Test 64-bit COMPARE LOGICAL IMMEDIATE AND BRANCH in cases where the sheer
# number of instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# m... | 4,217 | 31.198473 | 75 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-11.py | # Test 32-bit COMPARE LOGICAL IMMEDIATE AND BRANCH in cases where the sheer
# number of instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# m... | 4,168 | 30.824427 | 75 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-07.py | # Test 32-bit BRANCH RELATIVE ON COUNT in cases where some branches are out
# of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# loopN:
# load of countN
# ...
# loop0:
# 0xffd8 bytes, from MVIY instructions
# conditional branch to main
# after0:
# ...
# decrement of c... | 2,068 | 28.985507 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-01.py | # Test normal conditional branches in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0xffd8 ... | 3,201 | 28.376147 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-05.py | # Test 32-bit COMPARE IMMEDIATE AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# ... | 3,580 | 30.690265 | 77 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-08.py | # Test 64-bit BRANCH RELATIVE ON COUNT in cases where some branches are out
# of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# loopN:
# load of countN
# ...
# loop0:
# 0xffd8 bytes, from MVIY instructions
# conditional branch to main
# after0:
# ...
# decrement of c... | 2,095 | 28.942857 | 78 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-09.py | # Test 32-bit COMPARE LOGICAL AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0... | 3,566 | 31.135135 | 76 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-04.py | # Test 64-bit COMPARE AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0xffcc by... | 3,777 | 31.852174 | 76 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-02.py | # Test normal conditional branches in cases where block alignments cause
# some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu -align-all-blocks=8 | FileCheck %s
# Construct:
#
# b0:
# conditional branch to end
# ...
# b<N>:
# conditional branch to end
# b<N+1>:
# conditional bran... | 2,121 | 24.566265 | 82 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/spill-02.py | # Test cases where we spill from one frame index to another, both of which
# are out of range of MVC, and both of which need emergency spill slots.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# CHECK: f1:
# CHECK: %fallthru
# CHECK-DAG: stg [[REG1:%r[0-9]+]], 8168(%r15)
# CHECK-DAG: stg [[REG2:%r[0-... | 2,688 | 35.337838 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-10.py | # Test 64-bit COMPARE LOGICAL AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0... | 3,804 | 32.086957 | 76 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-03.py | # Test 32-bit COMPARE AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0xffcc by... | 3,540 | 30.900901 | 76 | py |
LowFat | LowFat-master/llvm-4.0.0.src/test/CodeGen/SystemZ/Large/branch-range-06.py | # Test 64-bit COMPARE IMMEDIATE AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# ... | 3,613 | 30.982301 | 77 | py |
LowFat | LowFat-master/llvm-4.0.0.src/docs/conf.py | # -*- coding: utf-8 -*-
#
# LLVM documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented... | 8,478 | 32.38189 | 80 | py |
LowFat | LowFat-master/llvm-4.0.0.src/utils/update_test_checks.py | #!/usr/bin/env python2.7
"""A script to generate FileCheck statements for regression tests.
This script is a utility to update LLVM opt or llc test cases with new
FileCheck patterns. It can either update all of the tests in the file or
a single test function.
Example usage:
$ update_test_checks.py --tool=../bin/opt ... | 15,046 | 35.879902 | 103 | py |
LowFat | LowFat-master/llvm-4.0.0.src/utils/extract_symbols.py | #!/usr/bin/env python
"""A tool for extracting a list of symbols to export
When exporting symbols from a dll or exe we either need to mark the symbols in
the source code as __declspec(dllexport) or supply a list of symbols to the
linker. This program automates the latter by inspecting the symbol tables of a
list of l... | 21,499 | 41.574257 | 98 | py |
LowFat | LowFat-master/llvm-4.0.0.src/utils/lldbDataFormatters.py | """
LLDB Formatters for LLVM data types.
Load into LLDB with 'command script import /path/to/lldbDataFormatters.py'
"""
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('type category define -e llvm -l c++')
debugger.HandleCommand('type synthetic add -w llvm '
... | 3,789 | 37.282828 | 77 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.