Commit Graph

142755 Commits

Author SHA1 Message Date
Dmitry Vyukov 7981ea8baa asan/tsan: fix compilation errors/bugs on Windows where long is 32-bit even in 64-bit mode
llvm-svn: 174312
2013-02-04 08:07:45 +00:00
Dmitry Vyukov 606de60163 tsan: intercept bind/listen
llvm-svn: 174311
2013-02-04 08:06:32 +00:00
Daniel Jasper 2603ee0dc6 Improve formatting of stream operators.
If there are string literals on either side of a '<<', chances are
high that they represent logically separate concepts. Otherwise,
the author could just have just a single literal (possible split
over multiple lines).

So, we can now nicely format things like:
cout << "somepacket = {\n"
     << "  val a = " << ValueA << "\n"
     << "  val b = " << ValueB << "\n"
     << "}";

llvm-svn: 174310
2013-02-04 07:34:48 +00:00
Daniel Jasper 1f140981b6 Improve handling of trailing block comments.
We can now (even in non-bin-packing modes) format:
someFunction(1, /* comment 1 */
             2, /* comment 2 */
             3, /* comment 3 */
             aaa);

llvm-svn: 174309
2013-02-04 07:32:14 +00:00
Daniel Jasper f7f13c0ef2 Fix an error in formatting of for-loops.
Two minor changes:
* Slight penalty for breaking at "," as opposed to ";".
* Don't apply bin-packing rules to for-loops.

Before:
for (int aaaaaa = aaaaaaaaaa; aaaaaa < bbbbbbbb; ++aaaaaa,
         ++ccccccccccccccc) {}

After:
for (int aaaaaa = aaaaaaaaaa; aaaaaa < bbbbbbbb;
     ++aaaaaa, ++ccccccccccccccc) {}

llvm-svn: 174308
2013-02-04 07:30:30 +00:00
Daniel Jasper 3a9370cbca Restructuring of token annotation for formatting.
This combines several changes:
* Calculation token type (e.g. for * and &) in the AnnotatingParser.
* Calculate the scope binding strength in the AnnotatingParser.
* Let <> and [] scopes bind stronger than () and {} scopes.
* Add minimal debugging output.

llvm-svn: 174307
2013-02-04 07:21:18 +00:00
Evgeniy Stepanov 1f5a71492d More MSan/ASan annotations.
This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains
fixes for 2 issues:

- X86JIT reads return address from stack, which MSan does not know is
  initialized.
- bugpoint tests run binaries with RLIMIT_AS. This does not work with certain
  Sanitizers.

We are no longer including config.h in Compiler.h with this change.

llvm-svn: 174306
2013-02-04 07:03:24 +00:00
David Blaikie 2811f8ac28 [DebugInfo] remove more node indirection (this time from the subprogram's variable lists)
llvm-svn: 174305
2013-02-04 05:56:36 +00:00
David Blaikie ab1e7cac99 PR15149: crash when printing debug info metadata containing an invalid language spec
llvm-svn: 174304
2013-02-04 05:31:37 +00:00
NAKAMURA Takumi cc4aaef0f2 clang/Analysis: Fix r174245, a valgrind error in AnalysisDeclContext::getBody(bool &IsAutosynthesized), to initialize IsAutosynthesized explicitly.
llvm-svn: 174303
2013-02-04 05:06:21 +00:00
Michael Gottesman e743a30850 Removed reference to LLVM as a project (since in LangRef it is used solely as a reference to the IR). Thanks silvas!
llvm-svn: 174301
2013-02-04 03:22:00 +00:00
Arnold Schwaighofer 98f1012f9b ARM cost model: Penalize insertelement into D subregisters
Swift has a renaming dependency if we load into D subregisters. We don't have a
way of distinguishing between insertelement operations of values from loads and
other values. Therefore, we are pessimistic for now (The performance problem
showed up in example 14 of gcc-loops).

radar://13096933

llvm-svn: 174300
2013-02-04 02:52:05 +00:00
Edwin Vane a9c5bb3ff3 Turn off uninitialized-use warnings for gcc in cmake build
Added support to the cmake build to turn off uninitialized use warnings
for gcc. This cleans the build up somewhat.

Used logic simpler than found in autoconf by making use of the fact that
although gcc won't complain about unsupported -Wno-* flags it *will*
complain about unsupported -W flags.

Reviewers: gribozavr, doug.gregor, chandlerc
llvm-svn: 174299
2013-02-04 02:32:44 +00:00
NAKAMURA Takumi 80159432de PPCDarwinAsmPrinter::EmitStartOfAsmFile(): Add checking range in CPUDirectives[].
llvm-svn: 174298
2013-02-04 00:47:38 +00:00
NAKAMURA Takumi 3d591ae0b9 PPCDarwinAsmPrinter::EmitStartOfAsmFile(): Add possible elements in CPUDirectives[].
llvm-svn: 174297
2013-02-04 00:47:33 +00:00
Dmitri Gribenko b614fab39d DeclPrinter: fix CXXConstructExpr printing with implicit default argument
This is an improvement of r173630, that handles the following case:

  struct VirualDestrClass
  {
    VirualDestrClass(int arg);
    virtual ~VirualDestrClass();
  };

  struct ConstrWithCleanupsClass
  {
    ConstrWithCleanupsClass(const VirualDestrClass& cplx = VirualDestrClass(42));
  };

  ConstrWithCleanupsClass cwcNoArg;

That was printed as:

  ConstrWithCleanupsClass cwcNoArg();

llvm-svn: 174296
2013-02-03 23:02:47 +00:00
Michael Gottesman 4c4ffd7783 Added instance variable/initializers/getter/setters for new keyword externally initialized to GlobalVariable. No *TRUE* functionality change.
I am going to add in the actual test cases with the actual functionality
changes in a later patch because I want to include some test cases.

To be clear when I say no *TRUE* functionality change I mean that this
patch (like it says in the title) only contains getters/setters and sets
up a default initial value of the instance variable to false so that
this patch does not affect any other uses of Global Variable.h.

llvm-svn: 174295
2013-02-03 21:54:38 +00:00
Benjamin Kramer 96951253bf Drop value names from test to get -Asserts builds back to green.
llvm-svn: 174294
2013-02-03 20:22:35 +00:00
Benjamin Kramer d9c8455adf CodeGen: Implement hint values for dynamic_cast as described in the Itanium C++ ABI.
This can yield dramatic speedups of dynamic_cast for simple inheritance trees,
at least with libsupc++. Neither libcxxabi nor libcxxrt make use of this
hint currently, it was never implemented because clang didn't support it.

There was some concern about the number of class hierarchy walks this change
introduces. If it turns out to be an issue we can add caching either at the cast
pair level or even deeper, but we also do a lot of walks in Sema so this
codepath is probably fairly optimized already.

llvm-svn: 174293
2013-02-03 19:59:25 +00:00
Benjamin Kramer 325d74566f CodeGen: Remove unnecessary const_casts. No functionality change.
llvm-svn: 174292
2013-02-03 18:55:34 +00:00
Daniel Jasper 1ca05ccf68 Fix bug in formatting of nested initializers.
We can now format:
SomeArrayOfSomeType a = { { { 1, 2, 3 } }, { { 1, 2, 3 } },
                          { { 111111111111111111111111111111,
                              222222222222222222222222222222,
                              333333333333333333333333333333 } },
                          { { 1, 2, 3 } }, { { 1, 2, 3 } } };

Before, we did strange things there.

llvm-svn: 174291
2013-02-03 18:07:15 +00:00
Dmitri Gribenko 2aedfbd177 Comment to XML conversion: replace string comparison with command ID comparison
llvm-svn: 174290
2013-02-03 17:48:05 +00:00
Benjamin Kramer b520633048 CodeGen: Mark the runtime function __dynamic_cast as readonly & nounwind.
This allows the optimizer to CSE dynamic_casts.

llvm-svn: 174289
2013-02-03 17:44:25 +00:00
Joerg Sonnenberger 981e99d560 Recognize aarch64 for --enable-targets as advertised.
llvm-svn: 174288
2013-02-03 17:06:49 +00:00
Dmitri Gribenko fb04e1b40c Remove unneeded const_casts
llvm-svn: 174287
2013-02-03 16:10:26 +00:00
Dmitri Gribenko 18aa3bb819 libclang: wrap CXString implementation into 'namespace cxstring'
This removes quite a few 'cxstring::' qualifications where they are obvious.

llvm-svn: 174286
2013-02-03 13:54:26 +00:00
Dmitri Gribenko 7489521eec libclang: remove 'using namespace cxstring'
llvm-svn: 174285
2013-02-03 13:52:47 +00:00
Dmitri Gribenko bf7bf10d45 libclang: migrate IndexingDeclVisitor to ConstDeclVisitor
llvm-svn: 174284
2013-02-03 13:42:20 +00:00
Dmitri Gribenko d73f73b0dd libclang: remove unneeded const_cast
llvm-svn: 174283
2013-02-03 13:26:20 +00:00
Dmitri Gribenko 37527c242a Constify ASTContext::getObjContainingInterface
llvm-svn: 174282
2013-02-03 13:23:21 +00:00
Dmitri Gribenko 82700578d4 libclang: migrate USRGenerator to ConstDeclVisitor
llvm-svn: 174281
2013-02-03 13:21:23 +00:00
Dmitri Gribenko dd7dacfff9 libclang: remove unneeded const_casts
llvm-svn: 174280
2013-02-03 13:19:54 +00:00
Nuno Lopes 500d592f67 use GEP::accumulateConstantOffset() to replace custom written code to compute GEP offset
llvm-svn: 174279
2013-02-03 13:17:11 +00:00
NAKAMURA Takumi 2209f97d19 clang/test/CodeGenCXX/debug-info-class.cpp: Tweak to unbreak test for a few targets.
- Relax a expression for arm-gnueabi.
  - Exclude msvc to limit target triplets to add limited a few targets.
    Feel free to remove actions if guys thought they redundant.

llvm-svn: 174278
2013-02-03 12:52:54 +00:00
Michael J. Spencer be1100e192 [Resolver] Improve undefined symbol error.
llvm-svn: 174277
2013-02-03 10:50:06 +00:00
Michael J. Spencer 7b7e8edb86 [ELF] Use LLVM_IS_UNALIGNED_ACCESS_FAST.
llvm-svn: 174276
2013-02-03 10:49:57 +00:00
Michael J. Spencer 7e813242af [ELF][Reader] Improve performance by removing calls to malloc.
llvm-svn: 174275
2013-02-03 10:49:47 +00:00
Michael J. Spencer 9a1da075b2 [ELF] Fix uninitialized variable.
llvm-svn: 174274
2013-02-03 10:49:37 +00:00
Michael J. Spencer 4673da27ef [Archive] Update to LLVM change.
llvm-svn: 174273
2013-02-03 10:49:26 +00:00
Michael J. Spencer 9718f45d39 [Object][Archive] Improve performance.
Improve performance of iterating over children and accessing the member file
buffer by caching the file size and moving code out to the header.

This also makes getBuffer return a StringRef instead of a MemoryBuffer. Both
fixing a memory leak and removing a malloc.

This takes getBuffer from ~10% of the time in lld to unmeasurable.

llvm-svn: 174272
2013-02-03 10:48:50 +00:00
Michael J. Spencer 39678d836c [Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.
llvm-svn: 174271
2013-02-03 10:48:31 +00:00
Michael Gottesman 8901bb66fb Added new Global Variable marker ``externally_initialized'' to LangRef.
llvm-svn: 174270
2013-02-03 09:57:18 +00:00
Michael Gottesman ef2bc77330 Added clarification paragraph to LangRef's documentation of
GlobalVariable about LLVM's assumptions vis-a-vis Global Variable
initial values and Global Variable initializers.

This is in preparation for adding the new keyword
externally_initialized.

Specifically, the patch explains how LLVM optimizes global initializers
by assumign that global variables defined within the module are not
modified from their initial values before the start of the global
initializer.

llvm-svn: 174269
2013-02-03 09:57:15 +00:00
Alex Rosenberg b65e88863e Spelling and grammar corrections.
llvm-svn: 174268
2013-02-03 07:05:26 +00:00
Jason Molenda b9c9f9b200 Change CommandObjectTargetSymbolsAdd to require that a target exists;
fixes crash of the form

% lldb
(lldb) target symbols add /tmp/symbols.dSYM
(lldb) Killed: 9

<rdar://problem/13139481> 

llvm-svn: 174267
2013-02-02 06:00:36 +00:00
David Blaikie 33111dfea0 Remove the (apparently) unnecessary debug info metadata indirection.
The main lists of debug info metadata attached to the compile_unit had an extra
layer of metadata nodes they went through for no apparent reason. This patch
removes that (& still passes just as much of the GDB 7.5 test suite). If anyone
can show evidence as to why these extra metadata nodes are there I'm open to
reverting this patch & documenting why they're there.

llvm-svn: 174266
2013-02-02 05:56:24 +00:00
Jordan Rose e0c260f137 Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
...again. The problem has not been fixed and our internal buildbot is still
getting hangs.

This reverts r174212, originally applied in r173951, then reverted in r174069.
Will not re-apply until the entire project analyzes successfully on my
local machine.

llvm-svn: 174265
2013-02-02 05:15:53 +00:00
Reed Kotler f8933f83f0 Start static relocation implementation for mips16.
This checkin makes hello world work. 

llvm-svn: 174264
2013-02-02 04:07:35 +00:00
Dmitri Gribenko 2f23e9c520 libclang: introduce cxstring::{createRef,createDup} for StringRefs
Also migrate all clients from the old API.

llvm-svn: 174263
2013-02-02 02:19:29 +00:00
Richard Smith c084bd2888 PR15132: Replace "address expression must be an lvalue or a function
designator" diagnostic with more correct and more human-friendly "cannot take
address of rvalue of type 'T'".

For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully
saying "cannot take address of rvalue of type '<overloaded function type>'".

For the case of &array_temporary, treat it just like a class temporary
(including allowing it as an extension); the existing diagnostic wording
for the class temporary case works fine.

llvm-svn: 174262
2013-02-02 02:14:45 +00:00