Commit Graph

887 Commits

Author SHA1 Message Date
Chris Bieneman dc76e70b2a Revert "[CMake] Improve the clang order-file generation workflow"
This reverts commit r259862, and attempts to fix builder CMakeCaches.

Will try this again some other time...

Conflicts:

	CMakeLists.txt
	tools/driver/CMakeLists.txt

llvm-svn: 259872
2016-02-05 03:40:37 +00:00
Chris Bieneman 1681091991 [CMake] Improve the clang order-file generation workflow
Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

Reviewers: bogner

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16896

llvm-svn: 259862
2016-02-05 01:22:03 +00:00
Chris Bieneman 2e4c67299e Add back the ABITest makefiles
These files are standalone and not integrated with CMake, so we probably want them.

llvm-svn: 259667
2016-02-03 17:16:01 +00:00
Craig Topper 054b391cf4 No need to use utostr when putting integers into a raw_ostream. NFC
llvm-svn: 259310
2016-01-31 00:20:26 +00:00
Chris Bieneman 2bf68c6c1c Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

    "This is the way [autoconf] ends
    Not with a bang but a whimper."
    -T.S. Eliot

Reviewers: chandlerc, grosbach, bob.wilson, echristo

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D16472

llvm-svn: 258862
2016-01-26 21:30:40 +00:00
Devin Coughlin 9ea8033d1b [analyzer] SATestBuild.py: Remove html and log when producing reference results.
The html reports are huge -- every issue in a given file results in a separate
copy of the source code, in HTML form, for the file. This gets very large
quickly and it doesn't make sense to check this into a reference repository.
Also remove the log when generating reference results because it can leak
absolute path names. We still keep both the html and the log around when
producing non-reference results.

llvm-svn: 258594
2016-01-23 01:09:07 +00:00
Devin Coughlin 86f61a9a62 [analyzer] SATestBuild.py: Handle spaces in path passed to --use-analyzer.
I missed this one in r258493.

llvm-svn: 258517
2016-01-22 18:45:22 +00:00
Devin Coughlin ab95cd2794 [analyzer] Update SATestBuild.py to handle spaces in paths.
The Jenkins workspace on the new Green Dragon builder for the static analyzer has spaces
in its path.

llvm-svn: 258493
2016-01-22 07:08:06 +00:00
Craig Topper 2576124eb5 [TableGen] Merge the SuperClass Record and SMRange vector a single vector. This removes the state needed to manage the extract vector. NFC
llvm-svn: 258066
2016-01-18 19:52:54 +00:00
Chris Bieneman 3f746e67df [CMake] Fix bots broken by including order file generation in check-all
llvm-svn: 257948
2016-01-15 22:44:18 +00:00
Chris Bieneman 6c33fc1ee0 [CMake] [Order-files] Use print_function as an attempt at being forward compatible.
Based on feedback from bogner.

llvm-svn: 257936
2016-01-15 21:30:06 +00:00
Chris Bieneman d8b5bde5d6 [CMake] Support generation of linker order files using dtrace
Summary:
This patch extends the lit-based perf-training tooling supplied for PGO data generation to also generate linker order files using dtrace.

This patch should work on any system that has dtrace. If CMake can find the dtrace tool it will generate a target 'generate-order-file' which will run the per-training tests wrapped by dtrace to capture function entries. There are several algorithms implemented for sorting the order files which can be experimented with for best performance. The dtrace wrapper also supports bot oneshot and pid probes.

The perf-helper.py changes to support order file construction are ported from internal changes by ddunbar; he gets all the credit for the hard work here, I just copy and pasted.

Note: I've tested these patches on FreeBSD and OS X 10.10.

Reviewers: ddunbar, bogner, silvas

Subscribers: llvm-commits, emaste

Differential Revision: http://reviews.llvm.org/D16134

llvm-svn: 257934
2016-01-15 21:21:12 +00:00
Craig Topper d3dfa14ad3 [TableGen] Call llvm_shutdown on exit so that all the ManagedStatic objects in the support library will be deleted.
llvm-svn: 256731
2016-01-04 04:51:46 +00:00
Chris Bieneman 2281622685 [CMake] Fixing a typo in a flag
Turns out cc1's flag has 1 - not 2...

llvm-svn: 256070
2015-12-19 00:56:12 +00:00
Chris Bieneman de879caeb8 [CMake] PGO training data
Adding in a few more lit substitutions for cc1 and the test exec path.

llvm-svn: 256057
2015-12-18 23:00:57 +00:00
Chris Bieneman ae5433907a [CMake] Add support for generating profdata for clang from training files
Summary:
This patch adds support for using LIT to drive generating PGO profile data for clang.

This first pass implementation should work on Linux and Unix based platforms. If you build clang using CMake with LLVM_BUILD_INSTRUMENTED=On the CMake build generates a generate-profdata target that will use the just-built clang to build any test files (see hello_world.cpp as an example). Each test compile will generate profraw files for each clang process. After all tests have run CMake will merge the profraw files using llvm-profdata.

Future opportunities for extension:
* Support for Build->Profile->Build bootstrapping
* Support for linker order file generation using a similar mechanism and the same training data
* Support for Windows

Reviewers: dexonsmith, friss, bogner, cmatthews, vsk, silvas

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15462

llvm-svn: 255740
2015-12-16 01:02:44 +00:00
Eugene Zelenko 5f02b777c6 Use range loops and autos in utils/TableGen/ClangAttrEmitter.cpp and generated code.
Differential revision: http://reviews.llvm.org/D15313

llvm-svn: 255042
2015-12-08 18:49:01 +00:00
Aaron Ballman 415c414bf2 Do not crash when dumping the objc_bridge_related attribute when its optional arguments are not supplied.
Patch thanks to Joe Ranieri!

llvm-svn: 254303
2015-11-30 15:25:34 +00:00
Devin Coughlin 2cb767d32b [analyzer] Update SATestBuild.py to enable a 'download and patch' model for projects.
Currently the SATestBuild.py and SATestAdd.py buildbot scripts expect project
sources to be checked into the project repository. This commit changes these
scripts to additionally support a model where project sources are downloaded
rather than checked into the repository. Sometimes projects may need to be
modified (for example, to support a newer versions of clang), so the updated scripts
also allow for an optional patch file that will be applied to the downloaded
project source before analysis.

To support this workflow, this commit changes the expected layout of
a project in the repository. The project-specific helper scripts will stay
in the root of each project directory, but the benchmark source itself (if
checked into the repo) should now be stored in a subdirectory named
'CachedSource':

  project_name/
    cleanup_run_static_analyzer.sh [optional]
    run_static_analyzer.cmd [required]
    download_project.sh [optional]
    CachedSource/ [optional]
    changes_for_analyzer.patch [optional]

If the 'CachedSource' source directory is not present, the download script will
be executed. This script should download the project source into 'CachedSource'.
Then, if 'changes_for_analyzer.patch' is present its changes will
be applied to a copy of 'CachedSource' before analysis.

Differential Revision: http://reviews.llvm.org/D14345

llvm-svn: 252410
2015-11-07 18:27:35 +00:00
John McCall a62c1a94c1 Add the ability to define "fake" arguments on attributes.
Fake arguments are automatically handled for serialization, cloning,
and other representational tasks, but aren't included in pretty-printing
or parsing (should we eventually ever automate that).

This is chiefly useful for attributes that can be written by the
user, but which are also frequently synthesized by the compiler,
and which we'd like to remember details of the synthesis for.
As a simple example, use this to narrow the cases in which we were
generating a specialized note for implicitly unavailable declarations.

llvm-svn: 251469
2015-10-28 00:17:34 +00:00
Gabor Horvath efec16307c [analyzer] Bug identification
This patch adds hashes to the plist and html output to be able to identfy bugs
for suppressing false positives or diff results against a baseline. This hash
aims to be resilient for code evolution and is usable to identify bugs in two
different snapshots of the same software. One missing piece however is a 
permanent unique identifier of the checker that produces the warning. Once that
issue is resolved, the hashes generated are going to change. Until that point
this feature is marked experimental, but it is suitable for early adoption.

Differential Revision: http://reviews.llvm.org/D10305 

Original patch by: Bence Babati!

llvm-svn: 251011
2015-10-22 11:53:04 +00:00
Alexey Bataev 6d45532961 [ATTR] Automatic line feed after pragma-like attribute.
Automatically insert line feed after pretty printing of all pragma-like attributes + fix printing of pragma-like pragmas on declarations.
Differential Revision: http://reviews.llvm.org/D13546

llvm-svn: 250017
2015-10-12 06:59:48 +00:00
Hans Wennborg dcfba33481 Fix Clang-tidy modernize-use-nullptr warnings in source directories; other minor cleanups
Patch by Eugene Zelenko!

Differential Revision: http://reviews.llvm.org/D13406

llvm-svn: 249484
2015-10-06 23:40:43 +00:00
Hans Wennborg 59dbe86325 Fix Clang-tidy modernize-use-nullptr warnings in headers and generated files; other minor cleanups.
By Eugene Zelenko!

Differential Revision: http://reviews.llvm.org/D13187

llvm-svn: 248828
2015-09-29 20:56:43 +00:00
Aaron Ballman 9d21454c16 Added MSVC natvis visualizers for Type and QualType. These could probably be improved, but anything is better than staring at hex values in the debugger.
llvm-svn: 248808
2015-09-29 17:32:36 +00:00
Devin Coughlin f3695c87cd [analyzer] SATestBuild.py: Move additional checkers logic so SATestAdd.py can use it as well.
Move the logic looking for additional checkers in the SA_ADDITIONAL_CHECKERS
environmental variable from SATestBuild's main() to runScanBuild(). This allows
SATestAdd.py to use the variable as well. Without it, we won't include
additional checkers when building reference results for the build bot.

Differential Revision: http://reviews.llvm.org/D12891

llvm-svn: 247767
2015-09-16 01:52:32 +00:00
Devin Coughlin bace032eb8 [analyzer] Update SATestBuild.py to set -isysroot for preprocessed files
Update the static analyzer buildbot script to set -isysroot to the OS X SDK path
when analyzing preprocessed files on OS X.

Differential Revision: http://reviews.llvm.org/D12769

llvm-svn: 247617
2015-09-14 21:22:24 +00:00
Aaron Ballman 74b5cdc034 Extend the Token visualizer used by MSVC to display the identifier text for tok::identifier tokens.
Patch by Mike Spertus.

llvm-svn: 247442
2015-09-11 18:35:18 +00:00
Ted Kremenek 3a0678e33c [analyzer] Apply whitespace cleanups by Honggyu Kim.
llvm-svn: 246978
2015-09-08 03:50:52 +00:00
Ahmed Bougacha 86da3d8d7c [ARM NEON] Remove special-case for f16 vcvt handling. NFCI.
We can use the 'H' typespec modifier to use 128-bit vectors directly
in the only two users of this special-case: the vcvt f16 intrinsics.
This also lets us use more meaningful prototype modifiers.

llvm-svn: 245778
2015-08-22 01:30:13 +00:00
Ahmed Bougacha cd5b8a0235 [ARM NEON] Use the common naming scheme for vcvt f16 builtins. NFC.
We had "vcvt_f16" and "VCVT_HIGH_F16": for other FP types, this naming
is used for intrinsics with integer overloads. The FP->FP conversions,
on the other hand, use the full "vcvt_f32_f64" name instead.

Use the same naming convention for the f16<->f32 conversions.
While there, reorder the definitions a little bit.

llvm-svn: 245763
2015-08-21 23:34:20 +00:00
Ahmed Bougacha 22a16965d6 [ARM NEON] Factor out FP-prototype checking. NFC.
llvm-svn: 245761
2015-08-21 23:24:18 +00:00
Gabor Horvath da32a86341 [Static Analyzer] Made it easier to test new checkers using the test suite.
llvm-svn: 245637
2015-08-20 22:59:49 +00:00
David Blaikie 4c96a5ef1c Fix memory ownership in the NeonEmitter by using values instead of pointers (smart or otherwise)
Improvement to the memory leak fix in 244196.

Address validity is required for the Intrinsic objects, but since the
collections only ever grow (no elements are removed), deque provides
sufficient guarantees (that the objects will never be reallocated/moved
around) for this use case.

llvm-svn: 244241
2015-08-06 18:29:32 +00:00
Yaron Keren 9f168530a2 Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.
llvm-svn: 244196
2015-08-06 07:28:36 +00:00
Chandler Carruth 38a45cc686 [UB] Guard two calls to memcpy in generated attribute code to handle
null StringRef objects as inputs.

Found by UBSan.

llvm-svn: 243949
2015-08-04 03:53:01 +00:00
Hans Wennborg 4afe504980 Fix -Wextra-semi warnings.
Patch by Eugene Zelenko!

Differential Revision: http://reviews.llvm.org/D11401

llvm-svn: 242931
2015-07-22 20:46:26 +00:00
Bob Wilson 0058b82c02 Refactor TableGen backend for ClangAttrEmitter to avoid duplication.
GenerateHasAttrSpellingStringSwitch and GenerateTargetRequirements had
duplicated code to check the conditions for target-specific attributes.
Refactor the duplicated code into a separate function. NFC.

llvm-svn: 242731
2015-07-20 22:57:36 +00:00
Bob Wilson 7c73083bd3 Ignore the "novtable" declspec when not using the Microsoft C++ ABI.
Clang used to silently ignore __declspec(novtable). It is implemented
now, but leaving the vtable uninitialized does not work when using the
Itanium ABI, where the class layout for complex class hierarchies is
stored in the vtable. It might be possible to honor the novtable
attribute in some simple cases and either report an error or ignore
it in more complex situations, but it’s not clear if that would be
worthwhile. There is also value in having a simple and predictable
behavior, so this changes clang to simply ignore novtable when not using
the Microsoft C++ ABI.

llvm-svn: 242730
2015-07-20 22:57:31 +00:00
Gabor Horvath c3177f2ed4 [Static Analyzer] Make the paths relative from the project root when generating reference results in the test suite.
llvm-svn: 241706
2015-07-08 18:39:31 +00:00
Craig Topper 839a25a8a7 [TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC
llvm-svn: 241431
2015-07-06 06:23:06 +00:00
Gabor Horvath 2ed9456015 [Static Analyzer] No longer include the full path of the source file in the single file tests' bug identifiers.
llvm-svn: 241292
2015-07-02 19:20:46 +00:00
Gabor Horvath 93fde94d81 [Static Analyzer] Minor improvements to SATest.
Differential Revision: http://reviews.llvm.org/D10812

llvm-svn: 241073
2015-06-30 15:31:17 +00:00
Alexander Kornienko ab9db51042 Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").
llvm-svn: 240353
2015-06-22 23:07:51 +00:00
Alexander Kornienko 3d9d929e42 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

  $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
      -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
      work/llvm/tools/clang

To reduce churn, not touching namespaces spanning less than 10 lines.

llvm-svn: 240270
2015-06-22 09:47:44 +00:00
Douglas Gregor bec595a641 Check for consistent use of nullability type specifiers in a header.
Adds a new warning (under -Wnullability-completeness) that complains
about pointer, block pointer, or member pointer declarations that have
not been annotated with nullability information (directly or inferred)
within a header that contains some nullability annotations. This is
intended to be used to help maintain the completeness of nullability
information within a header that has already been audited.

Note that, for performance reasons, this warning will underrepresent
the number of non-annotated pointers in the case where more than one
pointer is seen before the first nullability type specifier, because
we're only tracking one piece of information per header. Part of
rdar://problem/18868820.

llvm-svn: 240158
2015-06-19 18:27:45 +00:00
Ahmed Bougacha 94df730f7d [CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.
On ARM/AArch64, we currently always use EmitScalarExpr for the immediate
builtin arguments, instead of directly emitting the constant. When the
overflow sanitizer is enabled, this generates overflow intrinsics
instead of constants, breaking assumptions in various places.

Instead, use the knowledge of "immediates" to directly emit a constant:
- teach the tablegen backend to emit the "immediate" modifiers
- use those modifiers in the NEON CodeGen, on ARM and AArch64.

Fixes PR23517.

Differential Revision: http://reviews.llvm.org/D10045

llvm-svn: 239002
2015-06-04 01:43:41 +00:00
Russell Gallop 14c4dab603 [utils] Improvements to check_cfc.py to work better with some build systems.
Recognise options to output dependency files and don't perform checks.
Report input file name when reporting a check failure so it is more obvious in large build logs.

Differential Revision: http://reviews.llvm.org/D10183

llvm-svn: 238928
2015-06-03 15:09:13 +00:00
Russell Gallop aef6d17c8d [utils] Add exact check to check_cfc.py dash_s_no_change.
Files compiled with -via-file-asm should be byte for byte identical. This
change improves the checking on dash_s_no_change to detect non-code
differences. If there is a difference, the check goes on to compare code and
debug to try and be more informative.

llvm-svn: 238926
2015-06-03 14:33:57 +00:00
Benjamin Kramer 3204b152b5 Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.


Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

llvm-svn: 238601
2015-05-29 19:42:19 +00:00