Commit Graph

237 Commits

Author SHA1 Message Date
Kent Sommer a8105b3766 [clang-format] Add case aware include sorting.
Adds an option to [clang-format] which sorts headers in an alphabetical manner using case only for tie-breakers. The options is off by default in favor of the current ASCIIbetical sorting style.

Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D95017
2021-02-02 15:12:27 +01:00
Joachim Meyer c755e41c33 Fix -Wno-error= parsing in clang-format.
As noted in https://reviews.llvm.org/D86137#2460135 parsing of
the clang-format parameter -Wno-error=unknown fails.
This currently is done by having `-Wno-error=unknown` as an option.
In this patch this is changed to make `-Wno-error=` parse an enum into a bit set.
This way the parsing is fixed and also we can possibly add new options easily.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D93459
2020-12-17 22:23:42 +01:00
Duncan P. N. Exon Smith 75a95bc80e clang-format: Migrate createInMemoryFile to FileEntryRef, NFC 2020-12-09 15:00:53 -08:00
Duncan P. N. Exon Smith e763e032f8 Support: Change InMemoryFileSystem::addFileNoOwn to take a MemoryBufferRef, NFC
Found this by chance when looking at the InMemoryFileSystem API, seems
like an easy cleanup.

Differential Revision: https://reviews.llvm.org/D90893
2020-12-03 18:09:52 -08:00
mydeveloperday db6f7e0e9e [git-clang-format] Process CUDA header files
Clang supports compiling CUDA source files,
CUDA header files may contain CUDA specific code
that is why they have special extension, which
can be recognized by nvcc (CUDA compiler driver)
as CUDA source file.
Format them by default as well.

Reviewed By: MyDeveloperDay

Patch By: tomilov

Differential Revision: https://reviews.llvm.org/D90780
2020-11-14 12:39:16 +00:00
Nico Weber 637c77fda6 Revert "clang-format: Add a consumer to diagnostics engine"
This reverts commit df00267f1f.
clang-format should not depend on Frontend, see comment on
https://reviews.llvm.org/D90121.
2020-10-29 10:29:53 -04:00
Krasimir Georgiev df00267f1f clang-format: Add a consumer to diagnostics engine
Contributed by dmikis (Kirill Dmitrenko)!

Otherwise problems like trying to format readonly file in-place led to crashes.

I've added reviewers by looking at `git blame` and other reviews to the changed file, so may have missed someone.

Reviewed By: krasimir

Differential Revision: https://reviews.llvm.org/D90121
2020-10-29 11:28:27 +01:00
Duncan P. N. Exon Smith 59a3b1afb2 clang-format: Assert in-memory file created in createInMemoryFile, NFC
`SourceManager::createFileID` asserts that the given `FileEntry` is not
null, so remove the logic that passed in `nullptr`. Since we just added
the file to an in-memory FS via an API that cannot fail, use
`llvm_unreachable` on the error path. Didn't use an `assert` since it
seems cleaner semantically to check the error (and better,
hypothetically, for updating the API to use `Expected` instead of
`ErrorOr`).

I noticed this incidentally while auditing calls to `createFileID`.
2020-10-16 10:20:32 -04:00
Joachim Meyer f64903fd81 Add -Wno-error=unknown flag to clang-format.
Currently newer clang-format options cannot be included in .clang-format files, if not all users can be forced to use an updated version.
This patch tries to solve this by adding an option to clang-format, enabling to ignore unknown (newer) options.

Differential Revision: https://reviews.llvm.org/D86137
2020-09-19 10:17:57 +02:00
Miklos Vajna b168bbfae4 [clang-format] Recognize "hxx" as a C++ header in clang-format-diff.py
And shift "proto" to the next line to avoid a too long line.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D87931
2020-09-18 21:43:18 +02:00
Gi Vald 294e1900f2 Fix quiet mode in git-clang-format
Quiet mode is very useful for scripting, when only the diff format output is
required, or no output if not formatting is needed.
In case of no modified files, git-clang-format will output to screen even though
the quiet mode enabled.

This patch changes this behavior, so if quiet flag passes in - no output will be
available, even if no modified files exists.

Differential Revision: https://reviews.llvm.org/D85485
2020-08-26 18:15:52 +02:00
Walter Erquinigo 313b60742a Revert "Add Debug Info Size to Symbol Status"
This reverts commit 986e3af53b.

It incorrectly deleted clang/tools/clang-format/git-clang-format
2020-07-24 13:28:29 -07:00
Yifan Shen 986e3af53b Add Debug Info Size to Symbol Status
Summary: If a module has debug info, the size of debug symbol will be displayed after the Symbols Loaded Message for each module in the VScode modules view.{F12335461}

Reviewers: wallace, clayborg

Reviewed By: wallace, clayborg

Subscribers: cfe-commits, aprantl, lldb-commits

Tags: #lldb, #clang

Differential Revision: https://reviews.llvm.org/D83731
2020-07-24 13:26:06 -07:00
Jake Merdich 52b03aaa22 [clang-format][PR46043] Parse git config w/ implicit values
Summary:
https://bugs.llvm.org/show_bug.cgi?id=46043

Git's config is generally of the format 'key=val', but a setting
'key=true' can be written as just 'key'.  The git-clang-format script
expects a value and crashes in this case; this change handles implicit
'true' values in the script.

Reviewers: MyDeveloperDay, krasimir, sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80486
2020-05-24 20:32:54 -04:00
mydeveloperday 305a4abfd3 [clang-format] [PR45126] Help text is missing all available formats
Summary:
https://bugs.llvm.org/show_bug.cgi?id=45126

GNU and Microsoft styles are built in supported styles but are not displayed in the help text

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D79372
2020-05-07 19:50:21 +01:00
Christopher Tetreault 5a77b958e2 [NFC] Improve doc string to mention that paths in diff are used as-is
Summary:
Add --relative to the suggested git-diff one liner. If the user does not
pass this argument, then git will produce a diff with the path relative
to the repository root. If the user's working directory is not the
repository root, then clang-format will complain that the file is not
found. The --relative argument makes git produce a diff with the files
relative to the working directory.

Add note to doc string to warn users about the fact that filenames
embedded in the diff are used as-is with no attempts to "do what they
mean, not what they say"

Reviewers: djasper, alexfh, efriedma, klimek, thakis

Reviewed By: efriedma

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79054
2020-05-06 15:20:05 -07:00
Sam McCall 591be7ec50 [Format] Work around current vim bugs in clang-format.py
Summary:
Do line/col to byte conversions on the python side rather than relying on vim.
Its calculations are off when text annotations are present:
- https://github.com/vim/vim/issues/5930
- https://github.com/vim/vim/issues/3718 (fixed, but vim 8.1 is still common)

Reviewers: hokein

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78198
2020-04-15 20:11:14 +02:00
mydeveloperday 3b379246c3 [clang-format] A Minor change to clang-format-diff.py
Summary: Testing for None should use the 'is' operator.

Reviewed By: MyDeveloperDay

Patch By:  eagleoflqj

Tags: #clang-format

Differential Revision: https://reviews.llvm.org/D77974
2020-04-13 15:08:07 +01:00
Jim Lin d40afadec0 [git-clang-format] Fix typo in help message 2020-03-02 18:16:35 +08:00
mydeveloperday 79f8c20e2c update string comparison in clang-format.py
Summary: Python 3.8 introduces a SyntaxWarning about string comparisons with 'is'. This commit updates the string comparison in clang-format.py that is done with 'is not' to '!='. This should not break compatibility with older python versions (tested 3.4.9, 2.7.17, 2.7.5, 3.8.0).

Reviewers: MyDeveloperDay, klimek, llvm-commits, cfe-commits

Reviewed By: MyDeveloperDay, klimek

Patch By: pseyfert

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D70664
2019-12-06 17:36:56 +00:00
mydeveloperday b8e03ff503 [clang-format] update trailing newline treatment in clang-format.py
Summary:
The current clang-format.py does not handle trailing newlines at the end of a file correctly.
Trailing empty lines get removed except one.
As far as I understand this is because clang-format gets fed from stdin and writes to stdout when called from clang-format.py.
In a "normal" file (with no trailing empty lines) the string that gets passed to clang-format does not contain a trailing '\n' after the '\n'.join from python.
The clang-format binary does not add a trailing newline to input from stdin, but (if there are multiple trailing '\n', all except one get removed).

When reading back this means that we see in python from a "normal" file a string with no trailing '\n'. From a file with (potentially multiple) empty line(s) at the end, we get a string with one trailing '\n' back in python. In the former case all is fine, in the latter case split('\n') makes one empty line at the end of the file out of the clang-format output. Desired would be instead that the **file** ends with a newline, but not with an empty line.

For the case that a user specifies a range to format (and wants to keep trailing empty lines) I did **not** try to fix this by simply removing all trailing newlines from the clang-format output. Instead, I add a '\n' to the unformatted file content (i.e. newline-terminate what is passed to clang-format) and then strip off the last newline from the output (which itself is now for sure the newline termination of the clang-format output).

(Should this get approved, I'll need someone to help me land this.)

Reviewers: klimek, MyDeveloperDay

Reviewed By: MyDeveloperDay

Patch By: pseyfert

Subscribers: cfe-commits, llvm-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D70864
update trailing newline treatment in clang-format.py
2019-12-06 17:26:02 +00:00
mydeveloperday 52980576ee [clang-format] refactor the use of the SMDiagnostics in replacement warnings
Summary:
Review comments in {D69854} recommended a simpler approach of creating the SMDiagnostics to remove much of the complexity. (thanks @thakis)

@vlad.tsyrklevich I've rebuilt on both Windows and Linux (running Linux with Address and Undefined sanitizers) over the clang code base

Reviewers: thakis, klimek, mitchell-stellar, vlad.tsyrklevich

Reviewed By: thakis

Subscribers: cfe-commits, thakis, vlad.tsyrklevich

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D69921
2019-11-13 20:55:44 +00:00
mydeveloperday 335ac2eb66 Allow additional file suffixes/extensions considered as source in main include grouping
Summary:
By additional regex match, grouping of main include can be enabled in files that are not normally considered as a C/C++ source code.
For example, this might be useful in templated code, where template implementations are being held in *Impl.hpp files.
On the occassion, 'assume-filename' option description was reworded as it was misleading. It has nothing to do with `style=file` option and it does not influence sourced style filename.

Reviewers: rsmith, ioeric, krasimir, sylvestre.ledru, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, cfe-commits

Patch by:  furdyna

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67750
2019-11-12 21:26:52 +00:00
Sam McCall a81c1a9c56 [Format] Fix clang-format.el unit tests after commit f349cc37cc
Also add a comment that test is not automatically run, and how to run it.

Patch by Philipp Stephani!
2019-11-11 17:55:38 +01:00
paulhoad 6bf9e88ae4 [clang-format] update comments in clang-format.py for python3 compatibility
Summary:
D23319 introduced python3 compatibility to clang-format.py, this is however not reflected by the documentation in the comments at the beginning of the file, which show how to use the script with python2 in .vimrc. While the actual mapping a user might want to use may well differ from my suggestion, I think it's nice to show the python2 and python3 version, such that a user can pick from the suggestions instead of googeling the python3 replacement for `:pyf` which they might not be familiar with.

EDIT: picking reviewers according to https://llvm.org/docs/Phabricator.html#finding-potential-reviewers

Reviewers: klimek, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: ilya-biryukov, cfe-commits, llvm-commits, ychen

Patch By: pseyfert

Tags: #clang-tools-extra, #llvm, #clang

Differential Revision: https://reviews.llvm.org/D38446
2019-11-08 13:17:04 +00:00
paulhoad 3ddac7e563 [clang-format] [RELAND] Remove the dependency on frontend
Summary: relanding {D68969} after it failed UBSAN build caused by the passing of an invalid SMLoc() (nullptr)

Reviewers: thakis, vlad.tsyrklevich, klimek, mitchell-stellar

Reviewed By: thakis

Subscribers: merge_guards_bot, mgorny, cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D69854
2019-11-06 17:33:37 +00:00
paulhoad 7681435de1 [clang-format] Assert that filenames are not empty
Summary:
Adds asserts to catch empty filenames, which otherwise will cause a crash in SourceManager.
The clang-format tool now outputs an error if an empty filename is used.
Fixes bug: 34667

Reviewers: krasimir, djasper, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Patch by: @jr

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D56345
2019-11-06 17:25:17 +00:00
paulhoad f349cc37cc clang-format: Add a fallback style to Emacs mode
Summary:
This allows one to enable `clang-format-buffer` on file save and avoid
reformatting files that are outside of any project with .clang-format style.

Reviewers: djasper, klimek, sammccall, owenpan, mitchell-stellar, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Patch By: dottedmag

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D69752
2019-11-06 09:50:54 +00:00
Vlad Tsyrklevich efed314118 Revert "[clang-format] Remove the dependency on frontend"
This reverts commit ec66603ac7. It was
causing ubsan failures like the following on the ubsan bot:
llvm/lib/Support/SourceMgr.cpp:440:48: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffffa
2019-10-29 10:48:03 -07:00
paulhoad 8fa5e98fd1 [clang-format] Remove duplciate code from Invalid BOM detection
Summary:
Review comments on {D68767} asked that this duplicated code in clang-format was moved to one central location that being SourceManager (where it had originally be copied from I assume)

Moved function into static function  ContentCache::getInvalidBOM(...)  - (closest class to where it was defined before)
Updated clang-format to call this static function

Added unit tests for said new function in BasicTests

Sorry not my normal code area so may have the wrong reviewers. (but your names were on the recent history)

Reviewers: bruno, arphaman, klimek, owenpan, mitchell-stellar, dexonsmith

Reviewed By: owenpan

Subscribers: cfe-commits

Tags: #clang, #clang-format, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D68914
2019-10-24 20:24:44 +01:00
paulhoad ec66603ac7 [clang-format] Remove the dependency on frontend
Summary:
Address review comments from {D68554} by trying to drop the dependency again on Frontend whilst keeping the same format diagnostic messages

Not completely happy with having to do a split in order to get the StringRef for the Line the error occurred on, but could see a way to use SourceManager and SourceLocation to give me a single line?

But this removes the dependency on frontend which should keep the binary size down.

Reviewers: thakis, klimek, mitchell-stellar

Reviewed By: klimek

Subscribers: mgorny, cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D68969
2019-10-24 19:03:57 +01:00
Sam McCall bbb8eade69 [Format] Add machine-readable SPDX license ID to clang-format.el
llvm-svn: 374864
2019-10-15 07:25:18 +00:00
Paul Hoad 6a1f7d6c9f [clang-format] Proposal for clang-format to give compiler style warnings
relanding {D68554} with fixed lit tests, checked on Windows and MacOS

llvm-svn: 374720
2019-10-13 14:51:45 +00:00
Nico Weber e95d1ca1e2 Revert r374663 "[clang-format] Proposal for clang-format to give compiler style warnings"
The test fails on macOS and looks a bit wrong, see comments on the review.

Also revert follow-up r374686.

llvm-svn: 374688
2019-10-12 22:58:34 +00:00
Paul Hoad 1f20bc17d0 [clang-format] Proposal for clang-format to give compiler style warnings
Summary:
Related somewhat to {D29039}

On seeing a quote on twitter by @invalidop

> If it's not formatted with clang-format it's a build error.

This made me want to change the way I use clang-format into a tool that could optionally show me where my source code violates clang-format syle.

When I'm making a change to clang-format itself, one thing I like to do to test the change is to ensure I didn't cause a huge wave of changes, what I want to do is simply run this on a known formatted directory and see if any new differences arrive in a manner I'm used to.

This started me thinking that we should allow build systems to run clang-format on a whole tree and emit compiler style warnings about files that fail clang-format in a form that would make them as a warning in most build systems and because those build systems range in their construction I don't think its unreasonable to NOT expect them to have to do the directory searching or parsing the output replacements themselves, but simply transform that into an error code when there are changes required.

I am starting this by suggesing adding a -n or -dry-run command line argument which would emit a warning/error of the form

Support for various common compiler command line argumuments like '-Werror' and '-ferror-limit' could make this very flexible to be integrated into build systems and CI systems.

```
> $ /usr/bin/clang-format --dry-run ClangFormat.cpp -ferror-limit=3 -fcolor-diagnostics
> ClangFormat.cpp:54:29: warning: code should be clang-formatted [-Wclang-format-violations]
> static cl::list<std::string>
>                             ^
> ClangFormat.cpp:55:20: warning: code should be clang-formatted [-Wclang-format-violations]
> LineRanges("lines", cl::desc("<start line>:<end line> - format a range of\n"
>                    ^
> ClangFormat.cpp:55:77: warning: code should be clang-formatted [-Wclang-format-violations]
> LineRanges("lines", cl::desc("<start line>:<end line> - format a range of\n"
>                                                                             ^
```

Reviewers: mitchell-stellar, klimek, owenpan

Reviewed By: klimek

Subscribers: mgorny, cfe-commits

Tags: #clang-format, #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D68554

llvm-svn: 374663
2019-10-12 15:36:05 +00:00
Paul Hoad a65cfe3037 [clang-format] [NFC] Ensure clang-format is itself clang-formatted.
Summary:
Before making a proposed change, ensure ClangFormat.cpp is fully clang-formatted,

no functional change just clang-formatting using the in tree .clang-format.

Reviewers: mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: Eugene.Zelenko, cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D68551

llvm-svn: 373921
2019-10-07 16:53:35 +00:00
Paul Hoad 82aaf17412 [clang-format] [PR36858] Add missing .hh and .cs extensions from python support utilities
Summary: https://bugs.llvm.org/show_bug.cgi?id=36858 identifies .hh as a missing C++ header extension file while making this change I realized there was no support for .cs files which were added recently

Reviewers: pseyfert, klimek, owenpan

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D67949

llvm-svn: 372760
2019-09-24 14:00:06 +00:00
Harlan Haskins 8d323d1506 [clang] Adopt new FileManager error-returning APIs
Update the callers of FileManager::getFile and FileManager::getDirectory to handle the new llvm::ErrorOr-returning methods.

Signed-off-by: Harlan Haskins <harlan@apple.com>
llvm-svn: 367616
2019-08-01 21:31:56 +00:00
Nico Weber 532f756555 Improve clang-format-diff help output
The description in clang-format-diff.py is more useful than the one
in `clang-format-diff -h`, so use the same description in both places.

Differential Revision: https://reviews.llvm.org/D64998

llvm-svn: 366828
2019-07-23 17:34:18 +00:00
Tom Stellard 2e97d2aa1b cmake: Add CLANG_LINK_CLANG_DYLIB option
Summary:
Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against
libclang_shared.so instead of the individual component libraries.

Reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru

Subscribers: arphaman, cfe-commits, llvm-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63503

llvm-svn: 365092
2019-07-03 22:45:55 +00:00
Miklos Vajna 580a8bc69a [git-clang-format] recognize hxx as a C++ file
clangd, clang-tidy, etc does that already, no reason why
git-clang-format should skip hxx files.

Reviewed By: ilya-biryukov

Differential Revision: https://reviews.llvm.org/D63621

llvm-svn: 364014
2019-06-21 09:49:38 +00:00
Sam Clegg 8c24a57695 git-clang-format: Remove trailing whitespace in docstring. NFC.
Differential Revision: https://reviews.llvm.org/D62915

llvm-svn: 363759
2019-06-19 01:52:41 +00:00
Sam McCall aee9448939 [ClangFormat] Editor integrations inherit default style from clang-format binary
Summary:
This allows downstream customizations to the default style to work without
needing to also modify the editor integrations.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D49719

llvm-svn: 360996
2019-05-17 07:22:55 +00:00
Owen Pan 4ba5269f33 [clang-format] Fix the crash when formatting unsupported encodings
Fixes PR33946

Differential Revision: https://reviews.llvm.org/D61559

llvm-svn: 360257
2019-05-08 14:11:12 +00:00
Paul Hoad cbb726d0c5 [clang-format] Add basic support for formatting C# files
Summary:

This revision adds basic support for formatting C# files with clang-format, I know the barrier to entry is high here  so I'm sending this revision in to test the water as to whether this might be something we'd consider landing.

Tracking in Bugzilla as:
https://bugs.llvm.org/show_bug.cgi?id=40850

Justification:
C# code just looks ugly in comparison to the C++ code in our source tree which is clang-formatted.

I've struggled with Visual Studio reformatting to get a clean and consistent style, I want to format our C# code on saving like I do now for C++ and i want it to have the same style as defined in our .clang-format file, so it consistent as it can be with C++.  (Braces/Breaking/Spaces/Indent etc..)

Using clang format without this patch leaves the code in a bad state, sometimes when the BreakStringLiterals is set, it  fails to compile.

Mostly the C# is similar to Java, except instead of JavaAnnotations I try to reuse the TT_AttributeSquare.

Almost the most valuable portion is to have a new Language in order to partition the configuration for C# within a common .clang-format file, with the auto detection on the .cs extension. But there are other C# specific styles that could be added later if this is accepted. in particular how  `{ set;get }` is formatted.

Reviewers: djasper, klimek, krasimir, benhamilton, JonasToth

Reviewed By: klimek

Subscribers: llvm-commits, mgorny, jdoerfert, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D58404

llvm-svn: 356662
2019-03-21 13:09:22 +00:00
Serge Guelton 3331b6eab3 [tools] Fix python DeprecationWarning: invalid escape sequence
The python documentation says "it’s highly recommended that you use raw strings for all but the simplest expressions." (https://docs.python.org/3/library/re.html)

So do that with the attached patch generated by

    sed -i -e "s/re.search('/re.search(r'/g" $(git grep -l 're.search(')

The warning can be seen in e.g. python3.7:

    $ python3.7 -Wd
    >>> import re; re.search('\s', '')
    <stdin>:1: DeprecationWarning: invalid escape sequence \s

Commited on behalf of Marco Falke.
Differential Revision: https://reviews.llvm.org/D57528

llvm-svn: 353707
2019-02-11 15:03:17 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Serge Guelton f886c03e47 Portable Python script across Python version
StringIO is obsoleted in Python3, replaced by io.BytesIO or io.StringIO depending on the use.

Differential Revision: https://reviews.llvm.org/D55196

llvm-svn: 350318
2019-01-03 14:26:56 +00:00
Serge Guelton b748c0e696 Portable Python script across Python version
Make scripts more future-proof by importing most __future__ stuff.

Differential Revision: https://reviews.llvm.org/D55208

llvm-svn: 349504
2018-12-18 16:07:37 +00:00
Serge Guelton c0ebe773cd Portable Python script across Python version
Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version.

Differential Revision: https://reviews.llvm.org/D55213

llvm-svn: 349454
2018-12-18 08:36:33 +00:00