Commit Graph

161689 Commits

Author SHA1 Message Date
Hans Wennborg fc59812bee CMake: make building with /MT an option instead of always forcing it
for release builds.

This is a follow-up to r194589. Aaron pointed out that building
libraries with /MT and using them in an application that uses a
different run-time library can be a bad idea.

Move the option to build with /MT behind a CMake option so it can be
turned on selectively, such as when building the toolchain installer.

llvm-svn: 194596
2013-11-13 19:12:02 +00:00
Rafael Espindola 7cf6f00f56 Drop windows specific handling of equivalent destructors.
Now that the relevant tests use -mconstructor-aliases and the missing
features have been implemented, we can just drop this.

No functionality change.

llvm-svn: 194595
2013-11-13 18:46:32 +00:00
Weiming Zhao 580dcfbd27 Adds ARM backend options: -mrestrict-it and -mno-restrict-it
To support the generation of IT block in Thumbv7 way or
Thumbv8 way

llvm-svn: 194593
2013-11-13 18:31:23 +00:00
Weiming Zhao 0da5cc0765 Enable generating legacy IT block for AArch32
By default, the behavior of IT block generation will be determinated
dynamically base on the arch (armv8 vs armv7). This patch adds backend
options: -arm-restrict-it and -arm-no-restrict-it.  The former one
restricts the generation of IT blocks (the same behavior as thumbv8) for
both arches. The later one allows the generation of legacy IT block (the
same behavior as ARMv7 Thumb2) for both arches.

Clang will support -mrestrict-it and -mno-restrict-it, which is
compatible with GCC.

llvm-svn: 194592
2013-11-13 18:29:49 +00:00
Marshall Clow 00229a82cc Add directory for TSes, etc
llvm-svn: 194591
2013-11-13 18:25:56 +00:00
Argyrios Kyrtzidis 3e8547a5ca [objcmt] Use FileIDs directly instead of their hash value.
No functionality change.

llvm-svn: 194590
2013-11-13 18:20:31 +00:00
Hans Wennborg 079cb9b3e5 cmake: link release builds statically against run-time library on windows (use /MT instead of /MD)
This should fix the problem of snapshot builds created with MSVC 2012 not
working for users with MSVC 2010, etc.

Differential Revision: http://llvm-reviews.chandlerc.com/D2157

llvm-svn: 194589
2013-11-13 18:16:23 +00:00
David Blaikie 9208b5ed8e DIEHash: Move header include to be first in the implementation file to flush out header inclusion ordering issues
llvm-svn: 194588
2013-11-13 18:07:27 +00:00
Greg Clayton 3ebae49748 Fixed printf warnings. The GetByteSize() results return uint64_t values, not size_t values.
llvm-svn: 194587
2013-11-13 18:01:16 +00:00
Richard Sandiford 09de091cbe [SystemZ] Add the general form of BCR
At the moment this is just the MC support.

llvm-svn: 194585
2013-11-13 16:57:53 +00:00
Timur Iskhodzhanov 4ddf59201a No need to use CGM.getCXXABI() from CXXABI
llvm-svn: 194584
2013-11-13 16:03:43 +00:00
Alexander Potapenko 0706e5dd36 [ASan] Remove the stale dependency on the Foundation framework from the dynamic ASan runtime.
llvm-svn: 194583
2013-11-13 15:52:39 +00:00
Benjamin Kramer 9e501ec239 Move Delinearization pass into an anonymous namespace.
llvm-svn: 194582
2013-11-13 15:35:17 +00:00
Benjamin Kramer 505d2408a1 Make sure LLVMLoadLibraryPermanently gets an extern "C" symbol.
Otherwise it's impossible to use it. Also don't include C++ headers in
a C header.

llvm-svn: 194581
2013-11-13 15:35:13 +00:00
Alexey Samsonov cf6ac12e23 [Sanitizer] Use same PC threshold in slow unwinder on all platforms
llvm-svn: 194580
2013-11-13 15:20:10 +00:00
Alexey Samsonov 9ff4598225 [ASan] Do not rely on malloc context in allocator reports.
Invoke a fatal stack trace unwinder when ASan prints allocator-relevant
error reports (double-free, alloc-dealloc-mismatch, invalid-free).
Thus we'll be able to print complete stack trace even if allocation/free
stacks are not stored (malloc_context_size=0).

Based on the patch by Yuri Gribov!

llvm-svn: 194579
2013-11-13 14:46:58 +00:00
Alexey Samsonov 41f7c404c9 [ASan] Use new feature of FileCheck: provide multiple --check-prefix args
llvm-svn: 194578
2013-11-13 14:16:40 +00:00
Alexey Samsonov a7181a1b35 FileCheck: fix matching of one check-prefix is a prefix of another
Summary:
Fix a case when "FileCheck --check-prefix=CHECK --check-prefix=CHECKER"
would silently ignore check-lines of the form:
  CHECKER: foo

Reviewers: dsanders

Reviewed By: dsanders

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2168

llvm-svn: 194577
2013-11-13 14:12:52 +00:00
Alexander Kornienko 393e3088a1 Correctly mark first token in the presence of UTF-8 BOM.
Summary: Fixes http://llvm.org/PR17753

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D2159

llvm-svn: 194576
2013-11-13 14:04:17 +00:00
Rafael Espindola fdc88137f4 Remove AllowQuotesInName and friends from MCAsmInfo.
Accepting quotes is a property of an assembler, not of an object file. For
example, ELF can support any names for sections and symbols, but the gnu
assembler only accepts quotes in some contexts and llvm-mc in a few more.

LLVM should not produce different symbols based on a guess about which assembler
will be reading the code it is printing.

llvm-svn: 194575
2013-11-13 14:01:59 +00:00
Rafael Espindola 156227ac2b Don't call doFinalization from verifyFunction.
verifyFunction needs to call doInitialization to collect metadata and avoid
crashing when verifying debug info in a function.

But it should not call doFinalization since that is where the verifier will
check declarations, variables and aliases, which is not desirable when one
only wants to verify a function.

A possible cleanup would be to split the class into a ModuleVerifier and
FunctionVerifier.

Issue reported by Ilia Filippov. Patch by Michael Kruse.

llvm-svn: 194574
2013-11-13 13:44:11 +00:00
Alexander Potapenko fa82ba91f9 [ASan] Don't call __asan_init() from certain interceptors on Darwin.
Fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58994, which hadn't
manifested in LLVM because libclang_rt.asan_osx_dynamic.dylib used to depend on
the Foundation framework.
Without that dependency some interceptors may be called from the system
libraries before libSystem_initializer() is called, which lead to assertion
failures in sanitizer_mac.cc (_NSGetEnviron() returns NULL).

To fix the problem we fall back to the original functions in the common
libsanitizer interceptors and the __cxa_atexit() interceptor on Darwin.

This patch also prints a better error message in the case _NSGetEnviron()
returns NULL.

llvm-svn: 194573
2013-11-13 13:34:53 +00:00
Kostya Serebryany 04a1767a2e [asan] fix a leak in tds (https://code.google.com/p/address-sanitizer/issues/detail?id=233)
llvm-svn: 194572
2013-11-13 13:27:44 +00:00
Manuel Klimek 6192c93a53 Add an optional mapping from source paths to source contents.
This allows compilation database implementations for distributed build
systems to hand all data to the client to make parsing independent of
the file system.

llvm-svn: 194571
2013-11-13 13:23:27 +00:00
Vladimir Medic e10c1125df Fix bug in .gpword directive parsing.
llvm-svn: 194570
2013-11-13 13:18:04 +00:00
Zoran Jovanovic ccb70caa13 Support for microMIPS trap instruction with immediate operands.
llvm-svn: 194569
2013-11-13 13:15:03 +00:00
Alexey Samsonov aa19c0a1c3 Fix -Wdelete-non-virtual-dtor warnings by making SampleProfile methods non-virtual
llvm-svn: 194568
2013-11-13 13:09:39 +00:00
Diego Novillo 5c29705c13 Add -fprofile-sample-use to Clang's driver.
This adds a new option -fprofile-sample-use=filename to Clang. It
tells the driver to schedule the SampleProfileLoader pass and passes
on the name of the profile file to use.

llvm-svn: 194567
2013-11-13 12:22:39 +00:00
Diego Novillo 8d6568b56b SampleProfileLoader pass. Initial setup.
This adds a new scalar pass that reads a file with samples generated
by 'perf' during runtime. The samples read from the profile are
incorporated and emmited as IR metadata reflecting that profile.

The profile file is assumed to have been generated by an external
profile source. The profile information is converted into IR metadata,
which is later used by the analysis routines to estimate block
frequencies, edge weights and other related data.

External profile information files have no fixed format, each profiler
is free to define its own. This includes both the on-disk representation
of the profile and the kind of profile information stored in the file.
A common kind of profile is based on sampling (e.g., perf), which
essentially counts how many times each line of the program has been
executed during the run.

The SampleProfileLoader pass is organized as a scalar transformation.
On startup, it reads the file given in -sample-profile-file to
determine what kind of profile it contains.  This file is assumed to
contain profile information for the whole application. The profile
data in the file is read and incorporated into the internal state of
the corresponding profiler.

To facilitate testing, I've organized the profilers to support two file
formats: text and native. The native format is whatever on-disk
representation the profiler wants to support, I think this will mostly
be bitcode files, but it could be anything the profiler wants to
support. To do this, every profiler must implement the
SampleProfile::loadNative() function.

The text format is mostly meant for debugging. Records are separated by
newlines, but each profiler is free to interpret records as it sees fit.
Profilers must implement the SampleProfile::loadText() function.

Finally, the pass will call SampleProfile::emitAnnotations() for each
function in the current translation unit. This function needs to
translate the loaded profile into IR metadata, which the analyzer will
later be able to use.

This patch implements the first steps towards the above design. I've
implemented a sample-based flat profiler. The format of the profile is
fairly simplistic. Each sampled function contains a list of relative
line locations (from the start of the function) together with a count
representing how many samples were collected at that line during
execution. I generate this profile using perf and a separate converter
tool.

Currently, I have only implemented a text format for these profiles. I
am interested in initial feedback to the whole approach before I send
the other parts of the implementation for review.

This patch implements:

- The SampleProfileLoader pass.
- The base ExternalProfile class with the core interface.
- A SampleProfile sub-class using the above interface. The profiler
  generates branch weight metadata on every branch instructions that
  matches the profiles.
- A text loader class to assist the implementation of
  SampleProfile::loadText().
- Basic unit tests for the pass.

Additionally, the patch uses profile information to compute branch
weights based on instruction samples.

This patch converts instruction samples into branch weights. It
does a fairly simplistic conversion:

Given a multi-way branch instruction, it calculates the weight of
each branch based on the maximum sample count gathered from each
target basic block.

Note that this assignment of branch weights is somewhat lossy and can be
misleading. If a basic block has more than one incoming branch, all the
incoming branches will get the same weight. In reality, it may be that
only one of them is the most heavily taken branch.

I will adjust this assignment in subsequent patches.

llvm-svn: 194566
2013-11-13 12:22:21 +00:00
Alexey Samsonov 21a340fa99 FileCheck: fix a bug with multiple --check-prefix options.
Summary:
This fixes a subtle bug in new FileCheck feature added
in r194343. When we search for the first satisfying check-prefix,
we should actually return the first encounter of some check-prefix as a
substring, even if it's not a part of valid check-line. Otherwise
"FileCheck --check-prefix=FOO --check-prefix=BAR" with check file:

  FOO not a vaild check-line
  FOO: foo
  BAR: bar

incorrectly accepted file:

  fog
  bar

as it skipped the first two encounters of FOO, matching only BAR: line.

Reviewers: arsenm, dsanders

Reviewed By: dsanders

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2166

llvm-svn: 194565
2013-11-13 11:56:22 +00:00
Robert Lytton a83c0482dd XCore target: implement exception handling
llvm-svn: 194564
2013-11-13 10:19:31 +00:00
Sylvestre Ledru 59f661b94e Fix typo + add URL
llvm-svn: 194563
2013-11-13 10:07:16 +00:00
Vladimir Medic 77ffd7af4d This patch fixes a bug in floating point operands parsing, when instruction alias uses default register operand.
llvm-svn: 194562
2013-11-13 09:48:53 +00:00
NAKAMURA Takumi db5d18d245 Add XFAIL:arm again on 4 MCJIT tests, since r194558. AArch64 has been left removed.
They are failing on clang-native-arm-cortex-a9.

Please tweak MCJIT/lit.local.cfg, if this didn't satisfy bots.

llvm-svn: 194561
2013-11-13 07:43:10 +00:00
Rui Ueyama cc10b5b07e [PECOFF] Make ReaderCOFF more robust against planned identity_magic() changes.
No functionality change.

llvm-svn: 194560
2013-11-13 07:04:33 +00:00
Serge Pavlov 750db65bac Warn on duplicate function specifier
This patch fixes PR8264. Duplicate qualifiers already are diagnozed,
now the same diagnostics is issued for duplicate function specifiers.

Differential Revision: http://llvm-reviews.chandlerc.com/D2025

llvm-svn: 194559
2013-11-13 06:57:53 +00:00
NAKAMURA Takumi b71b7baa2f Remove XFAIL:aarch64,arm from 4 tests in test/ExecutionEngine/MCJIT.
They are reported as XPASSing.

llvm-svn: 194558
2013-11-13 06:28:00 +00:00
NAKAMURA Takumi 435f62a841 Mips16InstrInfo.cpp: Use <cctype> instead of <ctype.h>
Also, prune <stdlib.h>, seems stray.

llvm-svn: 194557
2013-11-13 06:27:53 +00:00
Rui Ueyama 6ac5dc379b Re-submit r194551: Use empty() instead of size() == 0.
llvm-svn: 194556
2013-11-13 05:19:47 +00:00
Reed Kotler 5c8ae09537 Allow the code which returns the length for inline assembler to know
specifically about the .space directive. This allows us to force large
blocks of code to appear in test cases for things like constant islands
without having to make giant test cases to force things like long 
branches to take effect.

llvm-svn: 194555
2013-11-13 04:37:52 +00:00
Peter Zotov de853be2ad Add myself to CODE_OWNERS for the OCaml bindings
Per discussion with Chris Lattner

llvm-svn: 194554
2013-11-13 04:24:13 +00:00
Andrew Trick 5469ae8f21 Add a test case to verify that misusing anyregcc crashes as expected.
llvm-svn: 194553
2013-11-13 03:46:19 +00:00
Rui Ueyama e20474d38c Revert "Use empty() instead of size() == 0."
This reverts commit r194551 because it broke the buildbot.

llvm-svn: 194552
2013-11-13 03:30:29 +00:00
Rui Ueyama 2235bff2b9 Use empty() instead of size() == 0.
llvm-svn: 194551
2013-11-13 03:09:20 +00:00
Rui Ueyama 12f390856c Fix misleading indentation.
llvm-svn: 194550
2013-11-13 03:00:48 +00:00
Chandler Carruth 3d7fd3daa3 Add another (perhaps better) video for Sean's talk. (Thanks Marshall!)
llvm-svn: 194549
2013-11-13 02:49:38 +00:00
Chandler Carruth ccb190972e Fix a null pointer dereference when copying a null polymorphic pointer.
This bug only bit the C++98 build bots because all of the actual uses
really do move. ;] But not *quite* ready to do the whole C++11 switch
yet, so clean it up. Also add a unit test that catches this immediately.

llvm-svn: 194548
2013-11-13 02:48:20 +00:00
Matt Arsenault 00a0d6f672 R600: Fix selection failure on EXTLOAD
llvm-svn: 194547
2013-11-13 02:39:07 +00:00
Enrico Granata 6e49c48f97 Small typos in previous commit
llvm-svn: 194546
2013-11-13 02:22:24 +00:00
Rui Ueyama e653f1d12c [PECOFF] Fix use-after-return.
llvm-svn: 194545
2013-11-13 02:21:51 +00:00