platform/upstream/llvm.git
11 years agoMake sure always-inline functions get inlined. <rdar://problem/12423986>
Bob Wilson [Sun, 7 Oct 2012 01:11:19 +0000 (01:11 +0000)]
Make sure always-inline functions get inlined. <rdar://problem/12423986>

Without this change, when the estimated cost for inlining a function with
an "alwaysinline" attribute was lower than the inlining threshold, the
getInlineCost function was returning that estimated cost rather than the
special InlineCost::AlwaysInlineCost value. That is fine in the normal
inlining case, but it can fail when the inliner considers the opportunity
cost of inlining into an internal or linkonce-odr function. It may decide
not to inline the always-inline function in that case. The fix here is just
to make getInlineCost always return the special value for always-inline
functions. I ran into this building clang with libc++. Tablegen failed to
link because of an always-inline function that was not inlined. I have been
unable to reduce the testcase down to a reasonable size.

llvm-svn: 165367

11 years agoDocument MapVector.
Rafael Espindola [Sun, 7 Oct 2012 00:56:09 +0000 (00:56 +0000)]
Document MapVector.

llvm-svn: 165366

11 years agoList of potential checkers: smart pointer checker: actually, unique_ptr<T[]>
Dmitri Gribenko [Sat, 6 Oct 2012 17:23:59 +0000 (17:23 +0000)]
List of potential checkers: smart pointer checker: actually, unique_ptr<T[]>
will do the right thing for new[] allocated memory.  Thanks David!

llvm-svn: 165365

11 years agoClang static analyzer docs: fix a couple of HTML markup issues and non-UTF-8
Dmitri Gribenko [Sat, 6 Oct 2012 17:14:39 +0000 (17:14 +0000)]
Clang static analyzer docs: fix a couple of HTML markup issues and non-UTF-8
characters.

llvm-svn: 165364

11 years agoList of potential checkers: more C++11 details for the smart pointer checker.
Dmitri Gribenko [Sat, 6 Oct 2012 16:59:15 +0000 (16:59 +0000)]
List of potential checkers: more C++11 details for the smart pointer checker.

llvm-svn: 165363

11 years agoExpose __builtin_bswap16.
Benjamin Kramer [Sat, 6 Oct 2012 14:42:22 +0000 (14:42 +0000)]
Expose __builtin_bswap16.

GCC has always supported this on PowerPC and 4.8 supports it on all platforms,
so it's a good idea to expose it in clang too. LLVM supports this on all targets.

llvm-svn: 165362

11 years agoPlace warn_impcast_different_enum_types in a new warning group, -Wenum-conversion...
Ted Kremenek [Sat, 6 Oct 2012 05:25:43 +0000 (05:25 +0000)]
Place warn_impcast_different_enum_types in a new warning group, -Wenum-conversion, that is a subgroup of -Wconversion.

llvm-svn: 165361

11 years agoAdd link to potential future checkers.
Ted Kremenek [Sat, 6 Oct 2012 05:11:15 +0000 (05:11 +0000)]
Add link to potential future checkers.

llvm-svn: 165360

11 years agoAdd list of potential checkers. Provided by Anton Yartsev!
Ted Kremenek [Sat, 6 Oct 2012 05:09:43 +0000 (05:09 +0000)]
Add list of potential checkers.  Provided by Anton Yartsev!

llvm-svn: 165359

11 years ago[analyzer] Tweak test to run the retain-count checker even on non-Darwin.
Jordan Rose [Sat, 6 Oct 2012 02:06:17 +0000 (02:06 +0000)]
[analyzer] Tweak test to run the retain-count checker even on non-Darwin.

This should fix the bots.

llvm-svn: 165358

11 years agoIn DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule(),
Jason Molenda [Sat, 6 Oct 2012 02:02:26 +0000 (02:02 +0000)]
In DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule(),
if we have a kernel binary, set the target's architecture to match.

Include the target's architecture in the ModuleSpec when we're searching for the
kext binaries on the local system -- otherwise we won't get a specific slice of
a fat file picked out for us and we won't use the returned Module correctly.

Remove the redundant attempt to find a file on the local filesystem from this method.

In ProcessGDBRemote::CheckForKernel(), if we have a kernel binary in memory, mark
the canJIT as false.  There is no jitting code in kernel debug sessions.

llvm-svn: 165357

11 years agoRevert Vishal's patch that Enrico commited, at least for the weekend. With it applied,
Jason Molenda [Sat, 6 Oct 2012 01:46:12 +0000 (01:46 +0000)]
Revert Vishal's patch that Enrico commited, at least for the weekend.  With it applied,
starting lldb I get

% ./lldb -x
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/build/Debug/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 9008
    raise TypeError("No array item of type %s" % str(type(key)))
        ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
(lldb)

I did a clean build and still got the problem so I'm backing this out until Enrico can
look at it.

llvm-svn: 165356

11 years agoParentMap: Restore the ability to update an existing map.
Jordan Rose [Sat, 6 Oct 2012 01:19:36 +0000 (01:19 +0000)]
ParentMap: Restore the ability to update an existing map.

The Clang ASTs are a DAG, not a pure tree. However, ParentMap has to
choose a single parent for each object. In the main (only?) cases in
which the AST forms a DAG, it protects from multiple traversal by using
OpaqueValueExprs. Previously, ParentMap would just unconditionally look
through all OpaqueValueExprs when building its map.

In order to make this behavior better for the analyzer's diagnostics,
ParentMap was changed to not set a statement's parent if there already
was one in the map. However, ParentMap is supposed to allow updating
existing mappings by calling addStmt once again. This change makes the
"transparency" of OpaqueValueExprs explicit, and disables it when it
is not desired, rather than checking the current contents of the map.

This new code seems like a big change, but it should actually have
essentially the same performance as before. Only OpaqueValueExprs and
their users (PseudoObjectExpr and BinaryConditionalOperator) will
have any different behavior.

There should be no user-visible functionality change, though a test
has been added for the current behavior of BinaryConditionalOperator
source locations and accompanying Xcode arrows (which are not so great...).

llvm-svn: 165355

11 years ago[analyzer] Handle implicit statements used for end-of-path nodes' source locs.
Jordan Rose [Sat, 6 Oct 2012 01:19:30 +0000 (01:19 +0000)]
[analyzer] Handle implicit statements used for end-of-path nodes' source locs.

Some implicit statements, such as the implicit 'self' inserted for "free"
Objective-C ivar access, have invalid source locations. If one of these
statements is the location where an issue is reported, we'll now look at
the enclosing statements for a valid source location.

<rdar://problem/12446776>

llvm-svn: 165354

11 years ago[libclang] Fix the comments, as suggested by Dmitri.
Argyrios Kyrtzidis [Sat, 6 Oct 2012 01:18:38 +0000 (01:18 +0000)]
[libclang] Fix the comments, as suggested by Dmitri.

llvm-svn: 165353

11 years ago[libclang] Don't disable the preprocessing record while indexing so as
Argyrios Kyrtzidis [Sat, 6 Oct 2012 01:18:35 +0000 (01:18 +0000)]
[libclang] Don't disable the preprocessing record while indexing so as
to not mess up with module building.

It was not worth trying to combine indexing without preprocessing record
and building modules with one because:

-just importing a module/PCH that was built with a pp record, enables it anyway
-the performance gain of indexing without the preprocessing record is insignificant.

llvm-svn: 165352

11 years agoAdding support for instructions mfc0, mfc2, mtc0, mtc2
Jack Carter [Sat, 6 Oct 2012 01:17:37 +0000 (01:17 +0000)]
Adding support for instructions mfc0, mfc2, mtc0, mtc2
move from and to coprocessors 0 and 2.

Contributer: Vladimir Medic
llvm-svn: 165351

11 years agoMinor changes based on post commit review:
Jack Carter [Sat, 6 Oct 2012 00:53:28 +0000 (00:53 +0000)]
Minor changes based on post commit review:

Contributer: Vladimir Medic
llvm-svn: 165350

11 years agoMake the error message from regex commands use the command's syntax string if it...
Jim Ingham [Sat, 6 Oct 2012 00:27:04 +0000 (00:27 +0000)]
Make the error message from regex commands use the command's syntax string if it exists rather than a generic but
not at all helpful message about not matching some unknown regex...

llvm-svn: 165349

11 years agopatch from Vishal Patel to improve our lldb.value wrapper
Enrico Granata [Sat, 6 Oct 2012 00:06:18 +0000 (00:06 +0000)]
patch from Vishal Patel to improve our lldb.value wrapper

llvm-svn: 165348

11 years agoFix another spot where this test varied for a Release build.
Alex Rosenberg [Fri, 5 Oct 2012 23:56:20 +0000 (23:56 +0000)]
Fix another spot where this test varied for a Release build.

llvm-svn: 165347

11 years agoMinor changes based on post commit review:
Jack Carter [Fri, 5 Oct 2012 23:55:28 +0000 (23:55 +0000)]
Minor changes based on post commit review:

Contributer: Vladimir Medic
llvm-svn: 165346

11 years agoMake test resilient to Release build temp names.
Alex Rosenberg [Fri, 5 Oct 2012 23:33:39 +0000 (23:33 +0000)]
Make test resilient to Release build temp names.

llvm-svn: 165345

11 years ago<rdar://problem/12442990> Fix the implementation of lldb.value.__eq__
Enrico Granata [Fri, 5 Oct 2012 23:20:58 +0000 (23:20 +0000)]
<rdar://problem/12442990> Fix the implementation of lldb.value.__eq__

llvm-svn: 165344

11 years agoPropagate calling convention for aliases and weakrefs.
Alex Rosenberg [Fri, 5 Oct 2012 23:12:53 +0000 (23:12 +0000)]
Propagate calling convention for aliases and weakrefs.

llvm-svn: 165343

11 years agoFileCheckize test
Alex Rosenberg [Fri, 5 Oct 2012 23:12:48 +0000 (23:12 +0000)]
FileCheckize test

llvm-svn: 165342

11 years ago<rdar://problem/12426557> Fixing the NSIndexSet data formatter
Enrico Granata [Fri, 5 Oct 2012 22:58:46 +0000 (22:58 +0000)]
<rdar://problem/12426557> Fixing the NSIndexSet data formatter

llvm-svn: 165341

11 years agoRemove "k" as an alias for "kill". It doesn't ask for confirmation and
Jason Molenda [Fri, 5 Oct 2012 22:56:23 +0000 (22:56 +0000)]
Remove "k" as an alias for "kill".  It doesn't ask for confirmation and
it's too easy to type by mistake when typing "l" (read: I did this once).

llvm-svn: 165340

11 years agoThread-safety analysis: allow attributes on constructors to refer to 'this'.
DeLesley Hutchins [Fri, 5 Oct 2012 22:38:19 +0000 (22:38 +0000)]
Thread-safety analysis: allow attributes on constructors to refer to 'this'.

llvm-svn: 165339

11 years agoAdd color output to 'diagtool tree' to show what warnings are enabled by default.
Ted Kremenek [Fri, 5 Oct 2012 22:07:14 +0000 (22:07 +0000)]
Add color output to 'diagtool tree' to show what warnings are enabled by default.

llvm-svn: 165338

11 years agoThis patch splits apart PPCISelLowering::LowerFormalArguments_Darwin_Or_64SVR4
Bill Schmidt [Fri, 5 Oct 2012 21:27:08 +0000 (21:27 +0000)]
This patch splits apart PPCISelLowering::LowerFormalArguments_Darwin_Or_64SVR4
into separate versions for the Darwin and 64-bit SVR4 ABIs.  This will
facilitate doing more major surgery on the 64-bit SVR4 ABI in the near future.

llvm-svn: 165336

11 years agoHowToSetUpLLVMStyleRTTI.rst: remove unneeded semicolons in code examples.
Dmitri Gribenko [Fri, 5 Oct 2012 20:52:13 +0000 (20:52 +0000)]
HowToSetUpLLVMStyleRTTI.rst: remove unneeded semicolons in code examples.

llvm-svn: 165335

11 years agoGoldPlugin.rst: minor typesetting fixes.
Dmitri Gribenko [Fri, 5 Oct 2012 20:50:05 +0000 (20:50 +0000)]
GoldPlugin.rst: minor typesetting fixes.

llvm-svn: 165334

11 years agoRemove two more cases of "-w write" being specified
Jason Molenda [Fri, 5 Oct 2012 20:28:11 +0000 (20:28 +0000)]
Remove two more cases of "-w write" being specified
to watch var set/exp -- that's now the default in the
shipped lldb.

llvm-svn: 165333

11 years agoImprove shortened examples of the watchpoint commands.
Jason Molenda [Fri, 5 Oct 2012 20:25:53 +0000 (20:25 +0000)]
Improve shortened examples of the watchpoint commands.
Document "f <n>" selects frame n.
"t <n>" selects thread n but this was just added to TOT
so most people won't have access to an lldb that accepts it.

llvm-svn: 165332

11 years agoRemove unused but set variable flagged by GCC.
Benjamin Kramer [Fri, 5 Oct 2012 20:08:45 +0000 (20:08 +0000)]
Remove unused but set variable flagged by GCC.

llvm-svn: 165331

11 years agoRemove the bt alias I inadvertently added back in in my last checkin.
Jim Ingham [Fri, 5 Oct 2012 19:48:19 +0000 (19:48 +0000)]
Remove the bt alias I inadvertently added back in in my last checkin.

llvm-svn: 165330

11 years agoChanging line endings from Windows to Unix. No functional changes.
Aaron Ballman [Fri, 5 Oct 2012 19:46:32 +0000 (19:46 +0000)]
Changing line endings from Windows to Unix.  No functional changes.

llvm-svn: 165329

11 years agoAdd one-shot breakpoints (-o option to "break set") and a tbreak alias for our gdb...
Jim Ingham [Fri, 5 Oct 2012 19:16:31 +0000 (19:16 +0000)]
Add one-shot breakpoints (-o option to "break set") and a tbreak alias for our gdb friends.

llvm-svn: 165328

11 years agoFix a test failure caused by checkin 165274.
Jim Ingham [Fri, 5 Oct 2012 19:14:57 +0000 (19:14 +0000)]
Fix a test failure caused by checkin 165274.

llvm-svn: 165327

11 years ago[ms-inline asm] Add a comment describing the MapAndConstraints.
Chad Rosier [Fri, 5 Oct 2012 19:00:51 +0000 (19:00 +0000)]
[ms-inline asm] Add a comment describing the MapAndConstraints.

llvm-svn: 165326

11 years agoAdd intrinsic of MULX in BMI2 header
Michael Liao [Fri, 5 Oct 2012 18:50:09 +0000 (18:50 +0000)]
Add intrinsic of MULX in BMI2 header

llvm-svn: 165325

11 years ago[ms-inline asm] Add a few typedefs to simplify future changes.
Chad Rosier [Fri, 5 Oct 2012 18:41:14 +0000 (18:41 +0000)]
[ms-inline asm] Add a few typedefs to simplify future changes.

llvm-svn: 165324

11 years agoPatch for integer multiply, signed/unsigned, long/long long.
Reed Kotler [Fri, 5 Oct 2012 18:27:54 +0000 (18:27 +0000)]
Patch for integer multiply, signed/unsigned, long/long long.

llvm-svn: 165322

11 years agoSimplify code, don't or a bool with an uint64_t.
Benjamin Kramer [Fri, 5 Oct 2012 18:19:44 +0000 (18:19 +0000)]
Simplify code, don't or a bool with an uint64_t.

No functionality change.

llvm-svn: 165321

11 years agoRemove empty file.
Benjamin Kramer [Fri, 5 Oct 2012 17:41:49 +0000 (17:41 +0000)]
Remove empty file.

llvm-svn: 165320

11 years agoRemove extraneous semicolon.
Chad Rosier [Fri, 5 Oct 2012 17:15:19 +0000 (17:15 +0000)]
Remove extraneous semicolon.

llvm-svn: 165319

11 years agoImplement TargetData with the DataLayout class, this will allow LLVM projects to...
Micah Villmow [Fri, 5 Oct 2012 17:02:14 +0000 (17:02 +0000)]
Implement TargetData with the DataLayout class, this will allow LLVM projects to transition to DataLayout without loosing functionality.

llvm-svn: 165318

11 years agotsan: cache pc's that cause suppressions (this way we do not need to symbolize the...
Dmitry Vyukov [Fri, 5 Oct 2012 15:51:32 +0000 (15:51 +0000)]
tsan: cache pc's that cause suppressions (this way we do not need to symbolize the reports)

llvm-svn: 165317

11 years agoAdd ELF program header.
Hemant Kulkarni [Fri, 5 Oct 2012 15:16:53 +0000 (15:16 +0000)]
Add ELF program header.

llvm-svn: 165316

11 years ago- Mark the BCC and BLR defs as isCodeGenOnly per error output from
Will Schmidt [Fri, 5 Oct 2012 15:16:11 +0000 (15:16 +0000)]
- Mark the BCC and BLR defs as isCodeGenOnly per error output from
llvm-tblgen -gen-asm-matcher.

 PPCInstrInfo.td |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

llvm-svn: 165315

11 years agoAdd PowerPC64 definitions for ELF.h
Adhemerval Zanella [Fri, 5 Oct 2012 14:32:46 +0000 (14:32 +0000)]
Add PowerPC64 definitions for ELF.h

llvm-svn: 165314

11 years agoEnable llvm/test/ExecutionEngine/MCJIT also for cygwin.
NAKAMURA Takumi [Fri, 5 Oct 2012 14:10:29 +0000 (14:10 +0000)]
Enable llvm/test/ExecutionEngine/MCJIT also for cygwin.

llvm-svn: 165313

11 years agolli: [MCJIT] Suppress "__main" for cygming in LLIMCJITMemoryManager::getPointerToName...
NAKAMURA Takumi [Fri, 5 Oct 2012 14:10:23 +0000 (14:10 +0000)]
lli: [MCJIT] Suppress "__main" for cygming in LLIMCJITMemoryManager::getPointerToNamedFunction(), like legacy JITMemoryManager's.

CRT's __main (aka premain) invokes global ctors on cygming. See also PR3897.

llvm-svn: 165312

11 years ago[CMake] Enhance add_llvm_external_project.
NAKAMURA Takumi [Fri, 5 Oct 2012 14:10:17 +0000 (14:10 +0000)]
[CMake] Enhance add_llvm_external_project.

  - Substitute hyphen to underscore, s/-/_/g, as the variable name.
  - Additional parameter can be specified as the name of directory.

e.g.) add_llvm_external_project(clang-tools-extra extra)

  - LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/path/to/llvm-srcroot/tools/clang/tools/extra, by default.
  - Build directory is in ${CMAKE_CURRENT_BINARY_DIR}/extra

llvm-svn: 165311

11 years agoFix incorrect setting of EI_DATA
Sid Manning [Fri, 5 Oct 2012 14:06:24 +0000 (14:06 +0000)]
Fix incorrect setting of EI_DATA

llvm-svn: 165310

11 years agoSROA.cpp: Fix a warning, [-Wunused-variable]
NAKAMURA Takumi [Fri, 5 Oct 2012 13:56:23 +0000 (13:56 +0000)]
SROA.cpp: Fix a warning, [-Wunused-variable]

llvm-svn: 165309

11 years agoConvert to unix line endings.
Rafael Espindola [Fri, 5 Oct 2012 13:32:38 +0000 (13:32 +0000)]
Convert to unix line endings.

llvm-svn: 165308

11 years agoIf !asan_inited, call internal versions of libc functions where available.
Alexander Potapenko [Fri, 5 Oct 2012 12:11:06 +0000 (12:11 +0000)]
If !asan_inited, call internal versions of libc functions where available.
This is to remove unnecessary #if directives.

llvm-svn: 165307

11 years agoMove this test a bit later, after the point at which we know that we either
Duncan Sands [Fri, 5 Oct 2012 07:29:46 +0000 (07:29 +0000)]
Move this test a bit later, after the point at which we know that we either
have an alloca or a parameter, since then the alloca test should make sense
to readers, while before it probably appears too specific.  No functionality
change.

llvm-svn: 165306

11 years agoMove methods out-of-line.
Bill Wendling [Fri, 5 Oct 2012 06:44:41 +0000 (06:44 +0000)]
Move methods out-of-line.

The internal representation of the Attributes class will be opaque. All of the
query methods will need to query the opaque class. Therefore, these methods need
to be out-of-line.
No functionality change intended.

llvm-svn: 165305

11 years agoUse method to query for attributes.
Bill Wendling [Fri, 5 Oct 2012 06:18:50 +0000 (06:18 +0000)]
Use method to query for attributes.

llvm-svn: 165304

11 years agoRemove some encoding bits I forgot to remove from SETB_C16r and SETB_C64r in r165302.
Craig Topper [Fri, 5 Oct 2012 06:11:52 +0000 (06:11 +0000)]
Remove some encoding bits I forgot to remove from SETB_C16r and SETB_C64r in r165302.

llvm-svn: 165303

11 years agoMove expansion of SETB_C(8/16/32/64)r from MCInstLower to ExpandPostRAPseudos and...
Craig Topper [Fri, 5 Oct 2012 06:05:15 +0000 (06:05 +0000)]
Move expansion of SETB_C(8/16/32/64)r from MCInstLower to ExpandPostRAPseudos and mark them as pseudos in the td file.

llvm-svn: 165302

11 years agoone more small fix for the gdb-comes-first column order
Jason Molenda [Fri, 5 Oct 2012 05:31:01 +0000 (05:31 +0000)]
one more small fix for the gdb-comes-first column order

llvm-svn: 165301

11 years agoChange the "bt" command alias defined in CommandInterpreter::LoadCommandDictionary.
Jason Molenda [Fri, 5 Oct 2012 05:29:32 +0000 (05:29 +0000)]
Change the "bt" command alias defined in CommandInterpreter::LoadCommandDictionary.
It is now a regex command alias that more faithfully emulates gdb's
behavior, most importantly, "bt 5" will backtrace 5 frames of the
currently selected thread.  "bt all" still backtraces all threads
(unlike gdb) and for users who have learned to use "bt -c 5", that
form is still accepted.

llvm-svn: 165300

11 years agoSymbols::LocateMacOSXFilesUsingDebugSymbols() - perform tilde
Jason Molenda [Fri, 5 Oct 2012 04:57:34 +0000 (04:57 +0000)]
Symbols::LocateMacOSXFilesUsingDebugSymbols() - perform tilde
expansion on the dSYM path we find if it starts with a tilde.

llvm-svn: 165299

11 years agoAdded forgotten break.
Abramo Bagnara [Fri, 5 Oct 2012 04:43:29 +0000 (04:43 +0000)]
Added forgotten break.

llvm-svn: 165298

11 years agotypeo
Jason Molenda [Fri, 5 Oct 2012 04:29:13 +0000 (04:29 +0000)]
typeo

llvm-svn: 165297

11 years agotypeo
Jason Molenda [Fri, 5 Oct 2012 04:28:53 +0000 (04:28 +0000)]
typeo

llvm-svn: 165296

11 years agoUpdate the intro paragraph of text describing the table below to
Jason Molenda [Fri, 5 Oct 2012 04:28:33 +0000 (04:28 +0000)]
Update the intro paragraph of text describing the table below to
reflect that the columns were just swapped.

llvm-svn: 165295

11 years agoSwap the columns in the lldb & gdb command comparison table. I
Jason Molenda [Fri, 5 Oct 2012 04:26:06 +0000 (04:26 +0000)]
Swap the columns in the lldb & gdb command comparison table.  I
often hear feedback from people that having the lldb commands on
the left hand side is non-intuitive -- they say "I want a *gdb* to
*lldb* table, not a *lldb* to *gdb* table".  It doesn't seem odious
to go from the right-hand column to the left hand column but I've
heard this same feedback enough that it's also pointless to keep
the format lldb-first, gdb-second when it was an arbitrary choice
to begin with.

llvm-svn: 165294

11 years agodocs: Add HowToSetUpLLVMStyleRTTI.rst.
Sean Silva [Fri, 5 Oct 2012 03:32:01 +0000 (03:32 +0000)]
docs: Add HowToSetUpLLVMStyleRTTI.rst.

This document describes how to set up LLVM-style RTTI for a class
hierarchy. Surprisingly, this was not previously documented.

Also, link it into ProgrammersManual.html.

llvm-svn: 165293

11 years agotblgen: Use appropriate LLVM-style RTTI functions.
Sean Silva [Fri, 5 Oct 2012 03:32:00 +0000 (03:32 +0000)]
tblgen: Use appropriate LLVM-style RTTI functions.

Use isa<> or cast<> when semantically that is what is happening. Also
some trivial "style" cleanups at fix sites.

llvm-svn: 165292

11 years agotblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.
Sean Silva [Fri, 5 Oct 2012 03:31:58 +0000 (03:31 +0000)]
tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.

This is a mechanical change of dynamic_cast<> to dyn_cast<>. A number of
these uses are actually more like isa<> or cast<>, and will be changed
to the semanticaly appropriate one in a future patch.

llvm-svn: 165291

11 years agotblgen: Put dyn_cast<> infrastructure in place for RecTy hierarchy.
Sean Silva [Fri, 5 Oct 2012 03:31:56 +0000 (03:31 +0000)]
tblgen: Put dyn_cast<> infrastructure in place for RecTy hierarchy.

llvm-svn: 165290

11 years agoMake sure to generate the right kind of MDNode for enum forward declarations.
Eli Friedman [Fri, 5 Oct 2012 01:49:33 +0000 (01:49 +0000)]
Make sure to generate the right kind of MDNode for enum forward declarations.
PR14029, clang part.

llvm-svn: 165289

11 years agoMake sure to generate the right kind of MDNode for enum forward declarations.
Eli Friedman [Fri, 5 Oct 2012 01:49:14 +0000 (01:49 +0000)]
Make sure to generate the right kind of MDNode for enum forward declarations.
PR14029, LLVM part.

llvm-svn: 165288

11 years agoFollow up to r165072. Try a different approach: only move the load when it's going...
Evan Cheng [Fri, 5 Oct 2012 01:48:22 +0000 (01:48 +0000)]
Follow up to r165072. Try a different approach: only move the load when it's going to be folded into the call. rdar://12437604

llvm-svn: 165287

11 years agoWorkaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's...
Richard Smith [Fri, 5 Oct 2012 01:46:25 +0000 (01:46 +0000)]
Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's going on, per Sean Silva's suggestion.

llvm-svn: 165286

11 years agoTeach the new SROA a new trick. Now we zap any memcpy or memmoves which
Chandler Carruth [Fri, 5 Oct 2012 01:29:09 +0000 (01:29 +0000)]
Teach the new SROA a new trick. Now we zap any memcpy or memmoves which
are in fact identity operations. We detect these and kill their
partitions so that even splitting is unaffected by them. This is
particularly important because Clang relies on emitting identity memcpy
operations for struct copies, and these fold away to constants very
often after inlining.

Fixes the last big performance FIXME I have on my plate.

llvm-svn: 165285

11 years agoLift the speculation visitor above all the helpers that are targeted at
Chandler Carruth [Fri, 5 Oct 2012 01:29:06 +0000 (01:29 +0000)]
Lift the speculation visitor above all the helpers that are targeted at
the rewrite visitor to make the fact that the speculation is completely
independent a bit more clear.

I promise that this is just a cut/paste of the one visitor and adding
the annonymous namespace wrappings. The diff may look completely
preposterous, it does in git for some reason.

llvm-svn: 165284

11 years agoImplement -Wshift-op-parentheses for: a << b + c
David Blaikie [Fri, 5 Oct 2012 00:41:03 +0000 (00:41 +0000)]
Implement -Wshift-op-parentheses for: a << b + c

This appears to be consistent with GCC's implementation of the same warning
under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user
defined type for compatibility with C++ stream IO. Otherwise suggest
parentheses around the addition or subtraction subexpression.

(this came up when MSVC was complaining (incorrectly, so far as I can tell)
about a perceived violation of this within the LLVM codebase, PR14001)

llvm-svn: 165283

11 years agoUse -object_path_lto when linking executables if building Apple style.
Bill Wendling [Fri, 5 Oct 2012 00:22:46 +0000 (00:22 +0000)]
Use -object_path_lto when linking executables if building Apple style.

llvm-svn: 165282

11 years ago[libclang] Now that we have a CXModule object, pass it to the
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:40 +0000 (00:22 +0000)]
[libclang] Now that we have a CXModule object, pass it to the
importedASTFile indexing callback.

llvm-svn: 165281

11 years ago[libclang] Introduce new C functions that provide information about modules:
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:37 +0000 (00:22 +0000)]
[libclang] Introduce new C functions that provide information about modules:

clang_Cursor_getModule
clang_Module_getParent
clang_Module_getName
clang_Module_getFullName
clang_Module_getNumTopLevelHeaders
clang_Module_getTopLevelHeader

llvm-svn: 165280

11 years ago[Modules] Introduce Module::TopHeaders which is a set of top-level headers
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:33 +0000 (00:22 +0000)]
[Modules] Introduce Module::TopHeaders which is a set of top-level headers
that are associated with a (sub)module.

llvm-svn: 165279

11 years ago[preprocessing record] Have PPEntityID be independent of the size of the
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:28 +0000 (00:22 +0000)]
[preprocessing record] Have PPEntityID be independent of the size of the
loaded entities vector, otherwise its meaning will change when a module
is imported and the vector size changes.

llvm-svn: 165278

11 years ago[libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
Argyrios Kyrtzidis [Fri, 5 Oct 2012 00:22:24 +0000 (00:22 +0000)]
[libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
import declaration.

llvm-svn: 165277

11 years agoTest case for r165275.
Chad Rosier [Thu, 4 Oct 2012 23:59:54 +0000 (23:59 +0000)]
Test case for r165275.

llvm-svn: 165276

11 years ago[ms-inline asm] Add support for parsing [Intel dialect] memory operands that use
Chad Rosier [Thu, 4 Oct 2012 23:59:38 +0000 (23:59 +0000)]
[ms-inline asm] Add support for parsing [Intel dialect] memory operands that use
segmented registers.  Test case to come.

llvm-svn: 165275

11 years ago<rdar://problem/12099999> renaming SBStream::Printf to Print in the scripting world...
Enrico Granata [Thu, 4 Oct 2012 23:54:09 +0000 (23:54 +0000)]
<rdar://problem/12099999> renaming SBStream::Printf to Print in the scripting world in order to avoid supporting varargs through SWIG

llvm-svn: 165274

11 years agoIf we flow off the end of a value-returning function:
Richard Smith [Thu, 4 Oct 2012 23:52:29 +0000 (23:52 +0000)]
If we flow off the end of a value-returning function:
 - outside C++, return undef (behavior is not undefined unless the value is used)
 - in C++, with -fcatch-undefined-behavior, perform an appropriate trap
 - in C++, produce an 'unreachable' (behavior is undefined immediately)

llvm-svn: 165273

11 years agoA tweak to the previous commit to ensure that we don't try to use -> on a NULL pointe...
Enrico Granata [Thu, 4 Oct 2012 23:17:01 +0000 (23:17 +0000)]
A tweak to the previous commit to ensure that we don't try to use -> on a NULL pointer (should not happen but better be safe than sorry)

llvm-svn: 165272

11 years ago<rdar://problem/12413390> Fixing an issue where synthetic ValueObjects do not properl...
Enrico Granata [Thu, 4 Oct 2012 23:13:00 +0000 (23:13 +0000)]
<rdar://problem/12413390> Fixing an issue where synthetic ValueObjects do not properly resolve their value

llvm-svn: 165271

11 years agoRename the Target specific passes in the DataLayout class to be Target agnostic.
Micah Villmow [Thu, 4 Oct 2012 23:01:22 +0000 (23:01 +0000)]
Rename the Target specific passes in the DataLayout class to be Target agnostic.

llvm-svn: 165270

11 years agoRan the sources through the compiler with -Wshadow warnings
Jason Molenda [Thu, 4 Oct 2012 22:47:07 +0000 (22:47 +0000)]
Ran the sources through the compiler with -Wshadow warnings
enabled after we'd found a few bugs that were caused by shadowed
local variables; the most important issue this turned up was
a common mistake of trying to obtain a mutex lock for the scope
of a code block by doing

        Mutex::Locker(m_map_mutex);

This doesn't assign the lock object to a local variable; it is
a temporary that has its dtor called immediately.  Instead,

        Mutex::Locker locker(m_map_mutex);

does what is intended.  For some reason -Wshadow happened to
highlight these as shadowed variables.

I also fixed a few obivous and easy shadowed variable issues
across the code base but there are a couple dozen more that
should be fixed when someone has a free minute.
<rdar://problem/12437585>

llvm-svn: 165269

11 years agoRemoved a directive to delete the test subdirectories
Sean Callanan [Thu, 4 Oct 2012 22:37:53 +0000 (22:37 +0000)]
Removed a directive to delete the test subdirectories
from LLVM and Clang.  This made "svn update" very
unpleasant if the original repository was fetched by
build-llvm.pl.

llvm-svn: 165268

11 years agoWhen merging connsecutive stores, use vectors to store the constant zero.
Nadav Rotem [Thu, 4 Oct 2012 22:35:15 +0000 (22:35 +0000)]
When merging connsecutive stores, use vectors to store the constant zero.

llvm-svn: 165267

11 years agoMade the i386 ABI mark EBP as non-volatile,
Sean Callanan [Thu, 4 Oct 2012 22:24:27 +0000 (22:24 +0000)]
Made the i386 ABI mark EBP as non-volatile,
because the unwinders typically can find its
value.

llvm-svn: 165266