platform/upstream/llvm.git
11 years agoTest for virtual instead of pure here. It has the exact same effect, and John
Nick Lewycky [Tue, 5 Feb 2013 06:20:31 +0000 (06:20 +0000)]
Test for virtual instead of pure here. It has the exact same effect, and John
claims it will improve performance.

llvm-svn: 174341

11 years agoAdded LLVM Asm/Bitcode Reader/Writer support for new IR keyword externally_initialized.
Michael Gottesman [Tue, 5 Feb 2013 05:57:38 +0000 (05:57 +0000)]
Added LLVM Asm/Bitcode Reader/Writer support for new IR keyword externally_initialized.

llvm-svn: 174340

11 years agoPR15095: Use more correct source locations for the InitListExpr we fake up for
Richard Smith [Tue, 5 Feb 2013 05:55:57 +0000 (05:55 +0000)]
PR15095: Use more correct source locations for the InitListExpr we fake up for
vector initialization. Patch by John Stratton!

llvm-svn: 174339

11 years agoRemove sparse text on diagnostic options. These are not really documented anywhere...
Ted Kremenek [Tue, 5 Feb 2013 05:55:21 +0000 (05:55 +0000)]
Remove sparse text on diagnostic options.  These are not really documented anywhere, and they really aren't for normal users.

llvm-svn: 174338

11 years agoAdd some missing diagnostics for C++11 narrowing conversions.
Richard Smith [Tue, 5 Feb 2013 05:52:24 +0000 (05:52 +0000)]
Add some missing diagnostics for C++11 narrowing conversions.

llvm-svn: 174337

11 years ago[Stack Alignment] emit warning instead of a hard error
Manman Ren [Mon, 4 Feb 2013 23:45:08 +0000 (23:45 +0000)]
[Stack Alignment] emit warning instead of a hard error

Per discussion in rdar://13127907, we should emit a hard error only if
people write code where the requested alignment is larger than achievable
and assumes the low bits are zeros. A warning should be good enough when
we are not sure if the source code assumes the low bits are zeros.

rdar://13127907

llvm-svn: 174336

11 years agoInitial cleanups of the param-attribute code in the bitcode reader/writer.
Bill Wendling [Mon, 4 Feb 2013 23:32:23 +0000 (23:32 +0000)]
Initial cleanups of the param-attribute code in the bitcode reader/writer.

Rename the PARAMATTR_CODE_ENTRY to PARAMATTR_CODE_ENTRY_OLD. It will be replaced
by another encoding. Keep around the current LLVM attribute encoder/decoder
code, but move it to the bitcode directories so that no one's tempted to use
them.

llvm-svn: 174335

11 years agoRemove the m_images(NULL) hack in the Target ctor now
Jason Molenda [Mon, 4 Feb 2013 23:30:05 +0000 (23:30 +0000)]
Remove the m_images(NULL) hack in the Target ctor now
that the original issue has been fixed by r174222.

llvm-svn: 174334

11 years ago<rdar://problem/12953018>
Enrico Granata [Mon, 4 Feb 2013 22:54:42 +0000 (22:54 +0000)]
<rdar://problem/12953018>

Synthetic children and summary for std::vector<bool> (for both libcxx and libstdcpp).
std::vector<bool> is a special case and is custom-implemented to be a vector of bits, which means we failed to handle it with the standard std::vector<T> formatter.
This checkin provides custom formatters that work correctly

llvm-svn: 174333

11 years agoReplace global std::string with const char[]
Alexey Samsonov [Mon, 4 Feb 2013 15:55:26 +0000 (15:55 +0000)]
Replace global std::string with const char[]

llvm-svn: 174332

11 years agoHexagon: Add V4 combine instructions and some more Def Pats for V2.
Jyotsna Verma [Mon, 4 Feb 2013 15:52:56 +0000 (15:52 +0000)]
Hexagon: Add V4 combine instructions and some more Def Pats for V2.

llvm-svn: 174331

11 years agoDisable a couple more vector splat optimizations on PPC.
Benjamin Kramer [Mon, 4 Feb 2013 15:52:32 +0000 (15:52 +0000)]
Disable a couple more vector splat optimizations on PPC.

I didn't see those because the test case used "not grep". FileCheck the test and
XFAIL it, preserving the old optimization, so this can be fixed eventually.

llvm-svn: 174330

11 years agoScopDetection: Improve printing of alias sets
Tobias Grosser [Mon, 4 Feb 2013 15:46:25 +0000 (15:46 +0000)]
ScopDetection: Improve printing of alias sets

We now show the all members of the alias set that may couse possible aliasing.
In case a alias set member is not a named instruction (unnamed instructions or
constant expressions), we show the expression itself.

This improves our error message

from:

  Possible aliasing for value: .reg2mem

to:

  Possible aliasing: ".reg2mem",
                     "[0 x double]* inttoptr (i64 47255179264 to [0 x double]*)

llvm-svn: 174329

11 years agoFix some abuses of StringRef
Tim Northover [Mon, 4 Feb 2013 15:44:38 +0000 (15:44 +0000)]
Fix some abuses of StringRef

We were taking a StringRef to a temporary result, which can go horribly wrong.

llvm-svn: 174328

11 years agoX86: Open up some opportunities for constant folding by postponing shift lowering.
Benjamin Kramer [Mon, 4 Feb 2013 15:19:33 +0000 (15:19 +0000)]
X86: Open up some opportunities for constant folding by postponing shift lowering.

Fixes PR15141.

llvm-svn: 174327

11 years agoX86: Simplify code. No functionality change.
Benjamin Kramer [Mon, 4 Feb 2013 15:19:25 +0000 (15:19 +0000)]
X86: Simplify code. No functionality change.

llvm-svn: 174326

11 years agoSelectionDAG: Teach FoldConstantArithmetic how to deal with vectors.
Benjamin Kramer [Mon, 4 Feb 2013 15:19:18 +0000 (15:19 +0000)]
SelectionDAG: Teach FoldConstantArithmetic how to deal with vectors.

This required disabling a PowerPC optimization that did the following:
input:
x = BUILD_VECTOR <i32 16, i32 16, i32 16, i32 16>
lowered to:
tmp = BUILD_VECTOR <i32 8, i32 8, i32 8, i32 8>
x = ADD tmp, tmp

The add now gets folded immediately and we're back at the BUILD_VECTOR we
started from. I don't see a way to fix this currently so I left it disabled
for now.

Fix some trivially foldable X86 tests too.

llvm-svn: 174325

11 years agoGive explicit suffix to integer constant over 32-bits.
Tim Northover [Mon, 4 Feb 2013 14:14:58 +0000 (14:14 +0000)]
Give explicit suffix to integer constant over 32-bits.

llvm-svn: 174324

11 years agoEnable AArch64 as a target built by default.
Tim Northover [Mon, 4 Feb 2013 12:32:21 +0000 (12:32 +0000)]
Enable AArch64 as a target built by default.

llvm-svn: 174322

11 years agoUpdate debugging test for change in expected metadata.
Tim Northover [Mon, 4 Feb 2013 12:15:00 +0000 (12:15 +0000)]
Update debugging test for change in expected metadata.

llvm-svn: 174321

11 years agoImplements the convenience matcher findAll.
Manuel Klimek [Mon, 4 Feb 2013 10:59:20 +0000 (10:59 +0000)]
Implements the convenience matcher findAll.

We found that findAll has been implemented incorrectly multiple times
by various people using the matchers. To prevent further wasted
development effort, it makes sense to add it as convenience matcher
implemented as eachOf(m, forEachDescendant(m)).

This patch also updates the docs with the new matchers.

llvm-svn: 174320

11 years agoasan/tsan: fix failing CHECK on windows
Dmitry Vyukov [Mon, 4 Feb 2013 10:42:38 +0000 (10:42 +0000)]
asan/tsan: fix failing CHECK on windows

llvm-svn: 174319

11 years ago[Sanitizer] use proper casting in *stat functions on Mac
Alexey Samsonov [Mon, 4 Feb 2013 10:31:39 +0000 (10:31 +0000)]
[Sanitizer] use proper casting in *stat functions on Mac

llvm-svn: 174318

11 years agoCoding standards: don't use ``inline`` when defining a function in a class
Dmitri Gribenko [Mon, 4 Feb 2013 10:24:58 +0000 (10:24 +0000)]
Coding standards: don't use ``inline`` when defining a function in a class
definition

Current practice is not to use 'inline' in:

  class Foo {
  public:
    inline void bar() {
      // ...
    }
  };

llvm-svn: 174317

11 years ago[Sanitizer] extend internal libc with stat/fstat/lstat functions
Alexey Samsonov [Mon, 4 Feb 2013 10:16:50 +0000 (10:16 +0000)]
[Sanitizer] extend internal libc with stat/fstat/lstat functions

llvm-svn: 174316

11 years agoAdd an eachOf matcher.
Manuel Klimek [Mon, 4 Feb 2013 09:42:38 +0000 (09:42 +0000)]
Add an eachOf matcher.

eachOf gives closure on the forEach and forEachDescendant matchers.
Before, it was impossible to implement a findAll matcher, as matching
the node or any of its descendants was not expressible (since anyOf
only triggers the first match).

llvm-svn: 174315

11 years agoImprove handling of trailing block comments
Daniel Jasper [Mon, 4 Feb 2013 08:34:57 +0000 (08:34 +0000)]
Improve handling of trailing block comments

This is a follow up to r174309 to actually make it work.

llvm-svn: 174314

11 years agoPass CPPFLAGS/CFLAGS/CXXFLAGS from the environment of configure to
Patrik Hagglund [Mon, 4 Feb 2013 08:15:53 +0000 (08:15 +0000)]
Pass CPPFLAGS/CFLAGS/CXXFLAGS from the environment of configure to
Makefile.config.

This is implied at the bottom of the help text of configure (besides
CC/CXX/LDFLAGS, already passed to Makefile.config).

For backward compatibility, the values of CFLAGS and CXXFLAGS defaults
to empty, overriding the default values provided by autoconf (for
example, '-g -O2' when CC=gcc').

$(CPP) is not used by our makefiles. Therefore, the value of CPP is
not passed to Makefile.config, despite beeing mentioned by 'configure
--help'.

llvm-svn: 174313

11 years agoasan/tsan: fix compilation errors/bugs on Windows where long is 32-bit even in 64...
Dmitry Vyukov [Mon, 4 Feb 2013 08:07:45 +0000 (08:07 +0000)]
asan/tsan: fix compilation errors/bugs on Windows where long is 32-bit even in 64-bit mode

llvm-svn: 174312

11 years agotsan: intercept bind/listen
Dmitry Vyukov [Mon, 4 Feb 2013 08:06:32 +0000 (08:06 +0000)]
tsan: intercept bind/listen

llvm-svn: 174311

11 years agoImprove formatting of stream operators.
Daniel Jasper [Mon, 4 Feb 2013 07:34:48 +0000 (07:34 +0000)]
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

11 years agoImprove handling of trailing block comments.
Daniel Jasper [Mon, 4 Feb 2013 07:32:14 +0000 (07:32 +0000)]
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

11 years agoFix an error in formatting of for-loops.
Daniel Jasper [Mon, 4 Feb 2013 07:30:30 +0000 (07:30 +0000)]
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

11 years agoRestructuring of token annotation for formatting.
Daniel Jasper [Mon, 4 Feb 2013 07:21:18 +0000 (07:21 +0000)]
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

11 years agoMore MSan/ASan annotations.
Evgeniy Stepanov [Mon, 4 Feb 2013 07:03:24 +0000 (07:03 +0000)]
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

11 years ago[DebugInfo] remove more node indirection (this time from the subprogram's variable...
David Blaikie [Mon, 4 Feb 2013 05:56:36 +0000 (05:56 +0000)]
[DebugInfo] remove more node indirection (this time from the subprogram's variable lists)

llvm-svn: 174305

11 years agoPR15149: crash when printing debug info metadata containing an invalid language spec
David Blaikie [Mon, 4 Feb 2013 05:31:37 +0000 (05:31 +0000)]
PR15149: crash when printing debug info metadata containing an invalid language spec

llvm-svn: 174304

11 years agoclang/Analysis: Fix r174245, a valgrind error in AnalysisDeclContext::getBody(bool...
NAKAMURA Takumi [Mon, 4 Feb 2013 05:06:21 +0000 (05:06 +0000)]
clang/Analysis: Fix r174245, a valgrind error in AnalysisDeclContext::getBody(bool &IsAutosynthesized), to initialize IsAutosynthesized explicitly.

llvm-svn: 174303

11 years agoRemoved reference to LLVM as a project (since in LangRef it is used solely as a refer...
Michael Gottesman [Mon, 4 Feb 2013 03:22:00 +0000 (03:22 +0000)]
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

11 years agoARM cost model: Penalize insertelement into D subregisters
Arnold Schwaighofer [Mon, 4 Feb 2013 02:52:05 +0000 (02:52 +0000)]
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

11 years agoTurn off uninitialized-use warnings for gcc in cmake build
Edwin Vane [Mon, 4 Feb 2013 02:32:44 +0000 (02:32 +0000)]
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

11 years agoPPCDarwinAsmPrinter::EmitStartOfAsmFile(): Add checking range in CPUDirectives[].
NAKAMURA Takumi [Mon, 4 Feb 2013 00:47:38 +0000 (00:47 +0000)]
PPCDarwinAsmPrinter::EmitStartOfAsmFile(): Add checking range in CPUDirectives[].

llvm-svn: 174298

11 years agoPPCDarwinAsmPrinter::EmitStartOfAsmFile(): Add possible elements in CPUDirectives[].
NAKAMURA Takumi [Mon, 4 Feb 2013 00:47:33 +0000 (00:47 +0000)]
PPCDarwinAsmPrinter::EmitStartOfAsmFile(): Add possible elements in CPUDirectives[].

llvm-svn: 174297

11 years agoDeclPrinter: fix CXXConstructExpr printing with implicit default argument
Dmitri Gribenko [Sun, 3 Feb 2013 23:02:47 +0000 (23:02 +0000)]
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

11 years agoAdded instance variable/initializers/getter/setters for new keyword externally initia...
Michael Gottesman [Sun, 3 Feb 2013 21:54:38 +0000 (21:54 +0000)]
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

11 years agoDrop value names from test to get -Asserts builds back to green.
Benjamin Kramer [Sun, 3 Feb 2013 20:22:35 +0000 (20:22 +0000)]
Drop value names from test to get -Asserts builds back to green.

llvm-svn: 174294

11 years agoCodeGen: Implement hint values for dynamic_cast as described in the Itanium C++ ABI.
Benjamin Kramer [Sun, 3 Feb 2013 19:59:25 +0000 (19:59 +0000)]
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

11 years agoCodeGen: Remove unnecessary const_casts. No functionality change.
Benjamin Kramer [Sun, 3 Feb 2013 18:55:34 +0000 (18:55 +0000)]
CodeGen: Remove unnecessary const_casts. No functionality change.

llvm-svn: 174292

11 years agoFix bug in formatting of nested initializers.
Daniel Jasper [Sun, 3 Feb 2013 18:07:15 +0000 (18:07 +0000)]
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

11 years agoComment to XML conversion: replace string comparison with command ID comparison
Dmitri Gribenko [Sun, 3 Feb 2013 17:48:05 +0000 (17:48 +0000)]
Comment to XML conversion: replace string comparison with command ID comparison

llvm-svn: 174290

11 years agoCodeGen: Mark the runtime function __dynamic_cast as readonly & nounwind.
Benjamin Kramer [Sun, 3 Feb 2013 17:44:25 +0000 (17:44 +0000)]
CodeGen: Mark the runtime function __dynamic_cast as readonly & nounwind.

This allows the optimizer to CSE dynamic_casts.

llvm-svn: 174289

11 years agoRecognize aarch64 for --enable-targets as advertised.
Joerg Sonnenberger [Sun, 3 Feb 2013 17:06:49 +0000 (17:06 +0000)]
Recognize aarch64 for --enable-targets as advertised.

llvm-svn: 174288

11 years agoRemove unneeded const_casts
Dmitri Gribenko [Sun, 3 Feb 2013 16:10:26 +0000 (16:10 +0000)]
Remove unneeded const_casts

llvm-svn: 174287

11 years agolibclang: wrap CXString implementation into 'namespace cxstring'
Dmitri Gribenko [Sun, 3 Feb 2013 13:54:26 +0000 (13:54 +0000)]
libclang: wrap CXString implementation into 'namespace cxstring'

This removes quite a few 'cxstring::' qualifications where they are obvious.

llvm-svn: 174286

11 years agolibclang: remove 'using namespace cxstring'
Dmitri Gribenko [Sun, 3 Feb 2013 13:52:47 +0000 (13:52 +0000)]
libclang: remove 'using namespace cxstring'

llvm-svn: 174285

11 years agolibclang: migrate IndexingDeclVisitor to ConstDeclVisitor
Dmitri Gribenko [Sun, 3 Feb 2013 13:42:20 +0000 (13:42 +0000)]
libclang: migrate IndexingDeclVisitor to ConstDeclVisitor

llvm-svn: 174284

11 years agolibclang: remove unneeded const_cast
Dmitri Gribenko [Sun, 3 Feb 2013 13:26:20 +0000 (13:26 +0000)]
libclang: remove unneeded const_cast

llvm-svn: 174283

11 years agoConstify ASTContext::getObjContainingInterface
Dmitri Gribenko [Sun, 3 Feb 2013 13:23:21 +0000 (13:23 +0000)]
Constify ASTContext::getObjContainingInterface

llvm-svn: 174282

11 years agolibclang: migrate USRGenerator to ConstDeclVisitor
Dmitri Gribenko [Sun, 3 Feb 2013 13:21:23 +0000 (13:21 +0000)]
libclang: migrate USRGenerator to ConstDeclVisitor

llvm-svn: 174281

11 years agolibclang: remove unneeded const_casts
Dmitri Gribenko [Sun, 3 Feb 2013 13:19:54 +0000 (13:19 +0000)]
libclang: remove unneeded const_casts

llvm-svn: 174280

11 years agouse GEP::accumulateConstantOffset() to replace custom written code to compute GEP...
Nuno Lopes [Sun, 3 Feb 2013 13:17:11 +0000 (13:17 +0000)]
use GEP::accumulateConstantOffset() to replace custom written code to compute GEP offset

llvm-svn: 174279

11 years agoclang/test/CodeGenCXX/debug-info-class.cpp: Tweak to unbreak test for a few targets.
NAKAMURA Takumi [Sun, 3 Feb 2013 12:52:54 +0000 (12:52 +0000)]
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

11 years ago[Resolver] Improve undefined symbol error.
Michael J. Spencer [Sun, 3 Feb 2013 10:50:06 +0000 (10:50 +0000)]
[Resolver] Improve undefined symbol error.

llvm-svn: 174277

11 years ago[ELF] Use LLVM_IS_UNALIGNED_ACCESS_FAST.
Michael J. Spencer [Sun, 3 Feb 2013 10:49:57 +0000 (10:49 +0000)]
[ELF] Use LLVM_IS_UNALIGNED_ACCESS_FAST.

llvm-svn: 174276

11 years ago[ELF][Reader] Improve performance by removing calls to malloc.
Michael J. Spencer [Sun, 3 Feb 2013 10:49:47 +0000 (10:49 +0000)]
[ELF][Reader] Improve performance by removing calls to malloc.

llvm-svn: 174275

11 years ago[ELF] Fix uninitialized variable.
Michael J. Spencer [Sun, 3 Feb 2013 10:49:37 +0000 (10:49 +0000)]
[ELF] Fix uninitialized variable.

llvm-svn: 174274

11 years ago[Archive] Update to LLVM change.
Michael J. Spencer [Sun, 3 Feb 2013 10:49:26 +0000 (10:49 +0000)]
[Archive] Update to LLVM change.

llvm-svn: 174273

11 years ago[Object][Archive] Improve performance.
Michael J. Spencer [Sun, 3 Feb 2013 10:48:50 +0000 (10:48 +0000)]
[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

11 years ago[Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.
Michael J. Spencer [Sun, 3 Feb 2013 10:48:31 +0000 (10:48 +0000)]
[Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.

llvm-svn: 174271

11 years agoAdded new Global Variable marker ``externally_initialized'' to LangRef.
Michael Gottesman [Sun, 3 Feb 2013 09:57:18 +0000 (09:57 +0000)]
Added new Global Variable marker ``externally_initialized'' to LangRef.

llvm-svn: 174270

11 years agoAdded clarification paragraph to LangRef's documentation of
Michael Gottesman [Sun, 3 Feb 2013 09:57:15 +0000 (09:57 +0000)]
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

11 years agoSpelling and grammar corrections.
Alex Rosenberg [Sun, 3 Feb 2013 07:05:26 +0000 (07:05 +0000)]
Spelling and grammar corrections.

llvm-svn: 174268

11 years agoChange CommandObjectTargetSymbolsAdd to require that a target exists;
Jason Molenda [Sat, 2 Feb 2013 06:00:36 +0000 (06:00 +0000)]
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

11 years agoRemove the (apparently) unnecessary debug info metadata indirection.
David Blaikie [Sat, 2 Feb 2013 05:56:24 +0000 (05:56 +0000)]
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

11 years agoRevert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Sat, 2 Feb 2013 05:15:53 +0000 (05:15 +0000)]
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

11 years agoStart static relocation implementation for mips16.
Reed Kotler [Sat, 2 Feb 2013 04:07:35 +0000 (04:07 +0000)]
Start static relocation implementation for mips16.
This checkin makes hello world work.

llvm-svn: 174264

11 years agolibclang: introduce cxstring::{createRef,createDup} for StringRefs
Dmitri Gribenko [Sat, 2 Feb 2013 02:19:29 +0000 (02:19 +0000)]
libclang: introduce cxstring::{createRef,createDup} for StringRefs

Also migrate all clients from the old API.

llvm-svn: 174263

11 years agoPR15132: Replace "address expression must be an lvalue or a function
Richard Smith [Sat, 2 Feb 2013 02:14:45 +0000 (02:14 +0000)]
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

11 years agoCorrectly classify T{} as an array temporary if T is an array of class type with...
Richard Smith [Sat, 2 Feb 2013 02:11:36 +0000 (02:11 +0000)]
Correctly classify T{} as an array temporary if T is an array of class type with nontrivial destructor.

llvm-svn: 174261

11 years agoAdd some horrible Perl code to teach scan-build to recursively walk a directory for...
Ted Kremenek [Sat, 2 Feb 2013 01:52:41 +0000 (01:52 +0000)]
Add some horrible Perl code to teach scan-build to recursively walk a directory for HTML files.

llvm-svn: 174260

11 years agoRemoving ssp and uwtable from the testcase
Manman Ren [Sat, 2 Feb 2013 01:34:38 +0000 (01:34 +0000)]
Removing ssp and uwtable from the testcase

llvm-svn: 174259

11 years agoAdded support for the qCmd monitor packet command. Currently it can only do:
Greg Clayton [Sat, 2 Feb 2013 01:13:48 +0000 (01:13 +0000)]
Added support for the qCmd monitor packet command. Currently it can only do:

set logfile=<path>
set logmask=<num>

But this opens the door for us to do much more.

llvm-svn: 174258

11 years agoDon't forget to run destructors when we create an array temporary of class type.
Richard Smith [Sat, 2 Feb 2013 01:13:06 +0000 (01:13 +0000)]
Don't forget to run destructors when we create an array temporary of class type.

llvm-svn: 174257

11 years agoRevert "Update checker build to checker-271."
Ted Kremenek [Sat, 2 Feb 2013 01:06:22 +0000 (01:06 +0000)]
Revert "Update checker build to checker-271."

Turns out we didn't update scan-build to work with HTML files in nested directories.

llvm-svn: 174256

11 years agoFixed another whitespace issue... *sigh*.
Michael Gottesman [Sat, 2 Feb 2013 01:05:06 +0000 (01:05 +0000)]
Fixed another whitespace issue... *sigh*.

llvm-svn: 174255

11 years agoFixed whitespace.
Michael Gottesman [Sat, 2 Feb 2013 01:03:01 +0000 (01:03 +0000)]
Fixed whitespace.

llvm-svn: 174254

11 years agoOn platforms which do not support ARC natively, do not mark objc_retain/objc_release...
Michael Gottesman [Sat, 2 Feb 2013 00:57:44 +0000 (00:57 +0000)]
On platforms which do not support ARC natively, do not mark objc_retain/objc_release as "nonlazybind".

rdar://13108298.
rdar://13129783.

llvm-svn: 174253

11 years agoUpdate checker build to checker-271.
Ted Kremenek [Sat, 2 Feb 2013 00:57:28 +0000 (00:57 +0000)]
Update checker build to checker-271.

llvm-svn: 174252

11 years agoRemove AttrBuilder::Raw().
Bill Wendling [Sat, 2 Feb 2013 00:52:44 +0000 (00:52 +0000)]
Remove AttrBuilder::Raw().

llvm-svn: 174251

11 years agoUse the AttributeSet's iterators.
Bill Wendling [Sat, 2 Feb 2013 00:42:06 +0000 (00:42 +0000)]
Use the AttributeSet's iterators.

Use the AttributeSet's iterators in AttrBuilder::hasAttributes() when
determining of the intersection of the AttrBuilder and AttributeSet is non-null.

llvm-svn: 174250

11 years agoRevert r174246, accidentally committed.
David Blaikie [Sat, 2 Feb 2013 00:39:32 +0000 (00:39 +0000)]
Revert r174246, accidentally committed.

This reverts commit 1513eb9284c23acfd19cf742b95996fbb11ca741.

llvm-svn: 174249

11 years agoSentenc-ify comment added in r174206.
David Blaikie [Sat, 2 Feb 2013 00:36:58 +0000 (00:36 +0000)]
Sentenc-ify comment added in r174206.

Based on post-commit review by Paul Robinson.

llvm-svn: 174248

11 years agoGeneralize DebugInfo tests by avoiding explicit metadata numbers
David Blaikie [Sat, 2 Feb 2013 00:34:26 +0000 (00:34 +0000)]
Generalize DebugInfo tests by avoiding explicit metadata numbers

This addresses several (not all) debug info tests that use explicit metadata
numbers. Wherever the same number appeared more than once in a test I used
a named match to ensure the same number appeared in all those cases (this may
still be overly constraining test cases as they may not have actually cared
about that relationship). For one-off numbers I just replaced them with an
unnamed regex.

This may underconstrain poorly written test cases that were interested in
checking that certain metadata nodes were related but didn't actually match
on all the related nodes numbers.

llvm-svn: 174247

11 years agoBasics
David Blaikie [Sat, 2 Feb 2013 00:34:16 +0000 (00:34 +0000)]
Basics

llvm-svn: 174246

11 years ago[analyzer] Always inline functions with bodies generated by BodyFarm.
Anna Zaks [Sat, 2 Feb 2013 00:30:04 +0000 (00:30 +0000)]
[analyzer] Always inline functions with bodies generated by BodyFarm.

Inlining these functions is essential for correctness. We often have
cases where we do not inline calls. For example, the shallow mode and
when reanalyzing previously inlined ObjC methods as top level.

llvm-svn: 174245

11 years ago[analyzer] Print Inline mode with -analyzer-display-progress.
Anna Zaks [Sat, 2 Feb 2013 00:30:02 +0000 (00:30 +0000)]
[analyzer] Print Inline mode with -analyzer-display-progress.

llvm-svn: 174244

11 years ago[analyzer] Fix typo.
Anna Zaks [Sat, 2 Feb 2013 00:29:59 +0000 (00:29 +0000)]
[analyzer] Fix typo.

llvm-svn: 174243

11 years agoThis patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
Nick Lewycky [Sat, 2 Feb 2013 00:25:55 +0000 (00:25 +0000)]
This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug that caused us to not mark the function referenced just
because we didn't want to mark it odr used.

llvm-svn: 174242

11 years agoRevert accidental commit (ran svn commit from wrong directory).
Nick Lewycky [Sat, 2 Feb 2013 00:25:26 +0000 (00:25 +0000)]
Revert accidental commit (ran svn commit from wrong directory).

llvm-svn: 174241

11 years agoThis patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
Nick Lewycky [Sat, 2 Feb 2013 00:22:37 +0000 (00:22 +0000)]
This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug in the previous patch that caused us to not mark the function
referenced just because we didn't want to mark it odr used.

llvm-svn: 174240