platform/upstream/llvm.git
11 years agoThis is a resubmittal. For some reason it broke the bots yesterday
Jack Carter [Sat, 19 Jan 2013 02:00:40 +0000 (02:00 +0000)]
This is a resubmittal. For some reason it broke the bots yesterday
but I cannot reproduce the problem and have scrubed my sources and
even tested with llvm-lit -v --vg.
Formatting fixes. Mostly long lines and
blank spaces at end of lines.

Contributer: Jack Carter

llvm-svn: 172882

11 years agoWhitespace.
NAKAMURA Takumi [Sat, 19 Jan 2013 01:54:35 +0000 (01:54 +0000)]
Whitespace.

llvm-svn: 172881

11 years agoExtended LLDB to handle blocks capturing 'self'
Sean Callanan [Sat, 19 Jan 2013 01:49:02 +0000 (01:49 +0000)]
Extended LLDB to handle blocks capturing 'self'
in an Objective-C class method.  Before, errors
of the form

error: cannot find interface declaration for '$__lldb_objc_class'

would appear when running any expression when
the current frame is a block that captures 'self'
from an Objective-C class method.

<rdar://problem/12905561>

llvm-svn: 172880

11 years agoRevert r172878, "Reword warning about using a *static* variable within its own initia...
NAKAMURA Takumi [Sat, 19 Jan 2013 01:47:46 +0000 (01:47 +0000)]
Revert r172878, "Reword warning about using a *static* variable within its own initialization."

It broke, at least, linux, msvc and mingw bots.

llvm-svn: 172879

11 years agoReword warning about using a *static* variable within its own initialization.
Ted Kremenek [Sat, 19 Jan 2013 00:49:00 +0000 (00:49 +0000)]
Reword warning about using a *static* variable within its own initialization.

The warning is still under -Wuninitialized (although technically this
is defined behavior), but under a subgroup -Wstatic-self-init.

This addresses PR 10265.

llvm-svn: 172878

11 years agoFix 80-col and early exit in cost model
Renato Golin [Sat, 19 Jan 2013 00:42:16 +0000 (00:42 +0000)]
Fix 80-col and early exit in cost model

llvm-svn: 172877

11 years ago<rdar://problem/13011717>
Greg Clayton [Sat, 19 Jan 2013 00:35:24 +0000 (00:35 +0000)]
<rdar://problem/13011717>

Fixed a compilation error that occurs when "lldb.macosx.heap" is imported and "ptr_refs" is used.

llvm-svn: 172876

11 years ago-Wuninitialized: warn about uninitialized values resulting from ?: that evaluate...
Ted Kremenek [Sat, 19 Jan 2013 00:25:06 +0000 (00:25 +0000)]
-Wuninitialized: warn about uninitialized values resulting from ?: that evaluate to lvalues (in C++).

llvm-svn: 172875

11 years agoRemove some register allocation order dependencies.
Jakob Stoklund Olesen [Sat, 19 Jan 2013 00:03:32 +0000 (00:03 +0000)]
Remove some register allocation order dependencies.

llvm-svn: 172874

11 years ago<rdar://problem/13010007>
Greg Clayton [Fri, 18 Jan 2013 23:41:08 +0000 (23:41 +0000)]
<rdar://problem/13010007>

Added the ability for OS plug-ins to lazily populate the thread this. The python OS plug-in classes can now implement the following method:

class OperatingSystemPlugin:
  def create_thread(self, tid, context):
    # Return a dictionary for a new thread to create it on demand

This will add a new thread to the thread list if it doesn't already exist. The example code in lldb/examples/python/operating_system.py has been updated to show how this call us used.

Cleaned up the code in PythonDataObjects.cpp/h:
- renamed all classes that started with PythonData* to be Python*.
- renamed PythonArray to PythonList. Cleaned up the code to use inheritance where
- Centralized the code that does ref counting in the PythonObject class to a single function.
- Made the "bool PythonObject::Reset(PyObject *)" function be virtual so each subclass can correctly check to ensure a PyObject is of the right type before adopting the object.
- Cleaned up all APIs and added new constructors for the Python* classes to they can all construct form:
- PyObject *
- const PythonObject &
- const lldb::ScriptInterpreterObjectSP &

Cleaned up code in ScriptInterpreterPython:
- Made calling python functions safer by templatizing the production of value formats. Python specifies the value formats based on built in C types (long, long long, etc), and code often uses typedefs for uint32_t, uint64_t, etc when passing arguments down to python. We will now always produce correct value formats as the templatized code will "do the right thing" all the time.
- Fixed issues with the ScriptInterpreterPython::Locker where entering the session and leaving the session had a bunch of issues that could cause the "lldb" module globals lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame to not be initialized.

llvm-svn: 172873

11 years agoFixing behavior of ELFObjectFile::getSymbolFileOffset().
Andrew Kaylor [Fri, 18 Jan 2013 23:40:42 +0000 (23:40 +0000)]
Fixing behavior of ELFObjectFile::getSymbolFileOffset().

llvm-svn: 172872

11 years agoDisassemble the vAttach packet.
Greg Clayton [Fri, 18 Jan 2013 23:30:12 +0000 (23:30 +0000)]
Disassemble the vAttach packet.

llvm-svn: 172871

11 years agoPass NO_MISSING_FIELD_INITIALIZERS to Compiler Flags
David Greene [Fri, 18 Jan 2013 23:22:52 +0000 (23:22 +0000)]
Pass NO_MISSING_FIELD_INITIALIZERS to Compiler Flags

configure checks whether -Wno-missing-field-initializers is a valid
compiler flag but it was never actually used in Makefile.rules.
Enable it to avoid some ridiculous warnings from gcc.

llvm-svn: 172870

11 years ago<rdar://problem/12976277>
Han Ming Ong [Fri, 18 Jan 2013 23:11:53 +0000 (23:11 +0000)]
<rdar://problem/12976277>

Swap in index ids for thread ids in GDBRemoteCommunicationClient. Besides dealing with the async logic, I have to take care of the situation when the inferior paused as well.

llvm-svn: 172869

11 years agoOn Sandybridge loading unaligned 256bits using two XMM loads (vmovups and vinsertf128...
Nadav Rotem [Fri, 18 Jan 2013 23:10:30 +0000 (23:10 +0000)]
On Sandybridge loading unaligned 256bits using two XMM loads (vmovups and vinsertf128) is faster than using a single vmovups instruction.

llvm-svn: 172868

11 years agoAdd code to retreive the mach port # for each thread in the inferior application's
Jason Molenda [Fri, 18 Jan 2013 23:07:45 +0000 (23:07 +0000)]
Add code to retreive the mach port # for each thread in the inferior application's
mach port namespace in addition to the mach port # in examine-threads' own port
namespace, and print it (when -v is used).

llvm-svn: 172867

11 years agoUse hexDigitValue in LLLexer.
Jordan Rose [Fri, 18 Jan 2013 23:05:41 +0000 (23:05 +0000)]
Use hexDigitValue in LLLexer.

llvm-svn: 172866

11 years agoRemove windows line endings.
David Blaikie [Fri, 18 Jan 2013 23:03:15 +0000 (23:03 +0000)]
Remove windows line endings.

llvm-svn: 172865

11 years agoImproved comment.
Michael Gottesman [Fri, 18 Jan 2013 23:02:45 +0000 (23:02 +0000)]
Improved comment.

llvm-svn: 172864

11 years agoFixed typo in comment.
Michael Gottesman [Fri, 18 Jan 2013 23:00:33 +0000 (23:00 +0000)]
Fixed typo in comment.

llvm-svn: 172863

11 years agoRemove unused variable
Matt Beaumont-Gay [Fri, 18 Jan 2013 22:34:17 +0000 (22:34 +0000)]
Remove unused variable

llvm-svn: 172862

11 years agoAdopt llvm::hexDigitValue.
Jordan Rose [Fri, 18 Jan 2013 22:33:58 +0000 (22:33 +0000)]
Adopt llvm::hexDigitValue.

llvm-svn: 172861

11 years agoFix mismatched #endif.
Jordan Rose [Fri, 18 Jan 2013 22:33:54 +0000 (22:33 +0000)]
Fix mismatched #endif.

llvm-svn: 172860

11 years agoOnce we've collected the template arguments for a
Douglas Gregor [Fri, 18 Jan 2013 22:27:09 +0000 (22:27 +0000)]
Once we've collected the template arguments for a
partially-substituted parameter pack in a template, forget about the
partially-substituted parameter pack: it is now completed. Fixes
<rdar://problem/12176336>.

llvm-svn: 172859

11 years agoThread-safety analysis: ignore edges from throw expressions in CFG.
DeLesley Hutchins [Fri, 18 Jan 2013 22:15:45 +0000 (22:15 +0000)]
Thread-safety analysis: ignore edges from throw expressions in CFG.

llvm-svn: 172858

11 years agoSplit out DW_OP_addr for the split debug info DWARF5 proposal.
Eric Christopher [Fri, 18 Jan 2013 22:11:33 +0000 (22:11 +0000)]
Split out DW_OP_addr for the split debug info DWARF5 proposal.

llvm-svn: 172857

11 years agoInclude ubsan runtime even when building a shared library. We don't require the execu...
Richard Smith [Fri, 18 Jan 2013 22:09:26 +0000 (22:09 +0000)]
Include ubsan runtime even when building a shared library. We don't require the executable to be linked with UBSan.

llvm-svn: 172856

11 years ago[mips] Enable inlining of atomic ops on mips32 and mips64.
Akira Hatanaka [Fri, 18 Jan 2013 21:58:11 +0000 (21:58 +0000)]
[mips] Enable inlining of atomic ops on mips32 and mips64.

llvm-svn: 172855

11 years agoIf the attributes don't exist, just bail for now.
Bill Wendling [Fri, 18 Jan 2013 21:56:07 +0000 (21:56 +0000)]
If the attributes don't exist, just bail for now.

llvm-svn: 172854

11 years agoUse AttributeSet accessor methods instead of Attribute accessor methods.
Bill Wendling [Fri, 18 Jan 2013 21:53:16 +0000 (21:53 +0000)]
Use AttributeSet accessor methods instead of Attribute accessor methods.

Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.

llvm-svn: 172853

11 years agoRemove unused parameter. Also use the AttributeSet query methods instead of the Attri...
Bill Wendling [Fri, 18 Jan 2013 21:50:24 +0000 (21:50 +0000)]
Remove unused parameter. Also use the AttributeSet query methods instead of the Attribute query methods.

llvm-svn: 172852

11 years agoAdd llvm::hexDigitValue to convert single characters to hex.
Jordan Rose [Fri, 18 Jan 2013 21:45:30 +0000 (21:45 +0000)]
Add llvm::hexDigitValue to convert single characters to hex.

This is duplicated in a couple places in the codebase. Adopt this in APFloat.

llvm-svn: 172851

11 years ago[Core] Fix passing an rvalue reference of ErrorOr.
Michael J. Spencer [Fri, 18 Jan 2013 21:42:01 +0000 (21:42 +0000)]
[Core] Fix passing an rvalue reference of ErrorOr.

llvm-svn: 172850

11 years agoUse the AttributeSet query method instead of the Attribute method.
Bill Wendling [Fri, 18 Jan 2013 21:26:07 +0000 (21:26 +0000)]
Use the AttributeSet query method instead of the Attribute method.

llvm-svn: 172849

11 years agoMade the expression handle variables with
Sean Callanan [Fri, 18 Jan 2013 21:20:51 +0000 (21:20 +0000)]
Made the expression handle variables with
DW_AT_const_value instead of a location.  Also
added a testcase covering "frame variable," "expr"
using the IR interpreter, and "expr" using the
LLVM JIT.

<rdar://problem/12978195>

llvm-svn: 172848

11 years agoThis is a resubmittal. For some reason it broke the bots yesterday
Jack Carter [Fri, 18 Jan 2013 21:20:38 +0000 (21:20 +0000)]
This is a resubmittal. For some reason it broke the bots yesterday
but I cannot reproduce the problem and have scrubed my sources and
even tested with llvm-lit -v --vg.
Support for Mips register information sections.

Mips ELF object files have a section that is dedicated
to register use info. Some of this information such as
the assumed Global Pointer value is used by the linker
in relocation resolution.

The register info file is .reginfo in o32 and .MIPS.options
in 64 and n32 abi files.

This patch contains the changes needed to create the sections,
but leaves the actual register accounting for a future patch.

Contributer: Jack Carter

llvm-svn: 172847

11 years agoR600: Proper insert S_WAITCNT instructions
Tom Stellard [Fri, 18 Jan 2013 21:15:53 +0000 (21:15 +0000)]
R600: Proper insert S_WAITCNT instructions

Some instructions like memory reads/writes are executed
asynchronously, so we need to insert S_WAITCNT instructions
to block before accessing their results. Previously we have
just inserted S_WAITCNT instructions after each async
instruction, this patch fixes this and adds a prober
insertion pass.

Patch by: Christian König

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
llvm-svn: 172846

11 years agoR600: Optimize and cleanup KILL on SI
Tom Stellard [Fri, 18 Jan 2013 21:15:50 +0000 (21:15 +0000)]
R600: Optimize and cleanup KILL on SI

We shouldn't insert KILL optimization if we don't have a
kill instruction at all.

Patch by: Christian König

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
llvm-svn: 172845

11 years agoPush some more methods down to hide the use of the Attribute class.
Bill Wendling [Fri, 18 Jan 2013 21:11:39 +0000 (21:11 +0000)]
Push some more methods down to hide the use of the Attribute class.

Because the Attribute class is going to stop representing a collection of
attributes, limit the use of it as an aggregate in favor of using AttributeSet.
This replaces some of the uses for querying the function attributes.

llvm-svn: 172844

11 years ago[PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!
Argyrios Kyrtzidis [Fri, 18 Jan 2013 20:59:01 +0000 (20:59 +0000)]
[PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!

Makes sure that a deserialized macro is only added to the preprocessor macro definitions only once.
Unfortunately I couldn't get a reduced test case.

rdar://13016031

llvm-svn: 172843

11 years agoThis is a resubmittal. For some reason it broke the bots yesterday
Jack Carter [Fri, 18 Jan 2013 20:15:06 +0000 (20:15 +0000)]
This is a resubmittal. For some reason it broke the bots yesterday
but I cannot reproduce the problem and have scrubed my sources and
even tested with llvm-lit -v --vg.

Removal of redundant code and formatting fixes.

Contributers: Jack Carter/Vladimir Medic

llvm-svn: 172842

11 years ago[Linker] Zap a dead typedef.
Daniel Dunbar [Fri, 18 Jan 2013 20:08:09 +0000 (20:08 +0000)]
[Linker] Zap a dead typedef.

llvm-svn: 172841

11 years agoUse insert instead of emplace until support/distribution improves on some platforms...
Matt Kopec [Fri, 18 Jan 2013 20:03:54 +0000 (20:03 +0000)]
Use insert instead of emplace until support/distribution improves on some platforms (ie. Linux).

llvm-svn: 172840

11 years agoSilence GCC warning about dropping off a non-void function.
Benjamin Kramer [Fri, 18 Jan 2013 19:45:22 +0000 (19:45 +0000)]
Silence GCC warning about dropping off a non-void function.

llvm-svn: 172839

11 years ago[Linker] Kill Linker::LoadObject which is dead, and drop the BitReader dependency...
Daniel Dunbar [Fri, 18 Jan 2013 19:37:11 +0000 (19:37 +0000)]
[Linker] Kill Linker::LoadObject which is dead, and drop the BitReader dependency again.

llvm-svn: 172838

11 years ago[MC/Mach-O] Implement integrated assembler support for linker options.
Daniel Dunbar [Fri, 18 Jan 2013 19:37:00 +0000 (19:37 +0000)]
[MC/Mach-O] Implement integrated assembler support for linker options.
 - Also, fixup syntax errors in LangRef and missing newline in the MCAsmStreamer.

llvm-svn: 172837

11 years agoDocumentation: remove all mentions of DejaGNU and Tcl
Dmitri Gribenko [Fri, 18 Jan 2013 19:27:43 +0000 (19:27 +0000)]
Documentation: remove all mentions of DejaGNU and Tcl

We don't have DejaGNU tests now.

llvm-svn: 172836

11 years agoStreamline the mentions of grep and FileCheck in TestingGuide.rst
Eli Bendersky [Fri, 18 Jan 2013 19:01:34 +0000 (19:01 +0000)]
Streamline the mentions of grep and FileCheck in TestingGuide.rst

grep is now only mentioned once in a sentence that explicitly says it's
deprecated. For FileCheck, there's no reason to repeat part of the
documentation that exists in CommandGuide/FileCheck.

llvm-svn: 172835

11 years agoFix parsing of class specifiers before '\n' 'operator'.
Nico Weber [Fri, 18 Jan 2013 18:41:42 +0000 (18:41 +0000)]
Fix parsing of class specifiers before '\n' 'operator'.

r159549 / r159164 regressed clang to reject

  struct s {};
  struct s
  operator++(struct s a)
  { return a; }

This fixes the regression. Richard, pleas check if this looks right.

llvm-svn: 172834

11 years ago[analyzer] Special path notes for C++ special member functions.
Jordan Rose [Fri, 18 Jan 2013 18:27:21 +0000 (18:27 +0000)]
[analyzer] Special path notes for C++ special member functions.

Examples:
  Calling implicit default constructor for Foo
  Calling defaulted move constructor for Foo
  Calling copy constructor for Foo
  Calling implicit destructor for Foo
  Calling defaulted move assignment operator for Foo
  Calling copy assignment operator for Foo

llvm-svn: 172833

11 years ago[analyzer] Do a better job describing C++ member functions in the call stack.
Jordan Rose [Fri, 18 Jan 2013 18:27:14 +0000 (18:27 +0000)]
[analyzer] Do a better job describing C++ member functions in the call stack.

Examples:
  Calling constructor for 'Foo'
  Entered call from 'Foo::create'

llvm-svn: 172832

11 years agoFix comment.
Manuel Klimek [Fri, 18 Jan 2013 18:24:28 +0000 (18:24 +0000)]
Fix comment.

llvm-svn: 172831

11 years agoFix a typo from r172289
Alexey Samsonov [Fri, 18 Jan 2013 17:03:47 +0000 (17:03 +0000)]
Fix a typo from r172289

llvm-svn: 172830

11 years agoCMake: Generalize build rules for different arches for sanitizer_common, asan, ubsan
Alexey Samsonov [Fri, 18 Jan 2013 16:51:07 +0000 (16:51 +0000)]
CMake: Generalize build rules for different arches for sanitizer_common, asan, ubsan

llvm-svn: 172829

11 years ago[ASan] Fix the log_path option to use different log files for parent and child proces...
Alexander Potapenko [Fri, 18 Jan 2013 16:44:27 +0000 (16:44 +0000)]
[ASan] Fix the log_path option to use different log files for parent and child processes after fork().

llvm-svn: 172828

11 years ago[sanitizer] Workaround broken mktemp on certain platforms.
Evgeniy Stepanov [Fri, 18 Jan 2013 16:24:50 +0000 (16:24 +0000)]
[sanitizer] Workaround broken mktemp on certain platforms.

llvm-svn: 172827

11 years agoCMake: create AddCompilerRT module and implement convenience add_compiler_rt_object_l...
Alexey Samsonov [Fri, 18 Jan 2013 16:05:21 +0000 (16:05 +0000)]
CMake: create AddCompilerRT module and implement convenience add_compiler_rt_object_library function

llvm-svn: 172826

11 years ago[sanitizer] Enable cpplint for .inc files.
Evgeniy Stepanov [Fri, 18 Jan 2013 15:53:43 +0000 (15:53 +0000)]
[sanitizer] Enable cpplint for .inc files.

llvm-svn: 172825

11 years agoThe IR linker still depends on the bitcode reader.
Benjamin Kramer [Fri, 18 Jan 2013 15:03:03 +0000 (15:03 +0000)]
The IR linker still depends on the bitcode reader.

llvm-svn: 172824

11 years agollvm/test/CodeGen/X86/Atomics-64.ll: Tweak for 2nd RUN not to overwrite %t. It someti...
NAKAMURA Takumi [Fri, 18 Jan 2013 14:52:02 +0000 (14:52 +0000)]
llvm/test/CodeGen/X86/Atomics-64.ll: Tweak for 2nd RUN not to overwrite %t. It sometimes causes spurious failure on lit win32.

Feel free to prune or suppress each output.

llvm-svn: 172823

11 years agoFixes issues around pulling in the next line in simple if statements.
Manuel Klimek [Fri, 18 Jan 2013 14:46:43 +0000 (14:46 +0000)]
Fixes issues around pulling in the next line in simple if statements.

llvm-svn: 172822

11 years agoIntroduce llvm::sys::PrintStackTraceOnErrorSignal()
NAKAMURA Takumi [Fri, 18 Jan 2013 14:31:00 +0000 (14:31 +0000)]
Introduce llvm::sys::PrintStackTraceOnErrorSignal()

llvm-svn: 172821

11 years agoclang/test/CodeGen: Suppress a couple of tests on win32. It seems -fsanitize-blacklis...
NAKAMURA Takumi [Fri, 18 Jan 2013 14:11:04 +0000 (14:11 +0000)]
clang/test/CodeGen: Suppress a couple of tests on win32. It seems -fsanitize-blacklist doesn't accept DOSish pathnames.

llvm-svn: 172820

11 years agoFixes problems with line merging in the face of preprocessor directives.
Manuel Klimek [Fri, 18 Jan 2013 14:04:34 +0000 (14:04 +0000)]
Fixes problems with line merging in the face of preprocessor directives.

This patch prepares being able to test for and fix more problems (see
FIXME in the test for example).

Previously we would output unwrapped lines for preprocessor directives
at the point where we also parsed the hash token. Since often
projections only terminate (and thus output their own unwrapped line)
after peeking at the next token, this would lead to the formatter seeing
the preprocessor directives out-of-order (slightly earlier). To be able
to correctly identify lines to merge, the formatter needs a well-defined
order of unwrapped lines, which this patch introduces.

llvm-svn: 172819

11 years agoclang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()
NAKAMURA Takumi [Fri, 18 Jan 2013 13:46:48 +0000 (13:46 +0000)]
clang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()

llvm-svn: 172818

11 years ago[sanitizer] lint
Evgeniy Stepanov [Fri, 18 Jan 2013 13:12:56 +0000 (13:12 +0000)]
[sanitizer] lint

llvm-svn: 172817

11 years agoCMake: start to generalize rules for non-x86 architectures
Alexey Samsonov [Fri, 18 Jan 2013 13:10:42 +0000 (13:10 +0000)]
CMake: start to generalize rules for non-x86 architectures

llvm-svn: 172816

11 years ago[asan] kill some dead code
Kostya Serebryany [Fri, 18 Jan 2013 13:01:44 +0000 (13:01 +0000)]
[asan] kill some dead code

llvm-svn: 172815

11 years ago[sanitizer] Rename 2 files *.h->*.inc as appropriate.
Evgeniy Stepanov [Fri, 18 Jan 2013 13:01:18 +0000 (13:01 +0000)]
[sanitizer] Rename 2 files *.h->*.inc as appropriate.

Also add a missing include.

llvm-svn: 172814

11 years ago80 columns
Alexey Samsonov [Fri, 18 Jan 2013 12:49:06 +0000 (12:49 +0000)]
80 columns

llvm-svn: 172813

11 years agoCMake variables renaming: X86_64->x86_64 I386->i386
Alexey Samsonov [Fri, 18 Jan 2013 12:45:44 +0000 (12:45 +0000)]
CMake variables renaming: X86_64->x86_64 I386->i386

llvm-svn: 172812

11 years ago[sanitizer] Remove an unused variable.
Evgeniy Stepanov [Fri, 18 Jan 2013 12:32:02 +0000 (12:32 +0000)]
[sanitizer] Remove an unused variable.

llvm-svn: 172811

11 years ago[ASan] Fix compilation on Mac.
Alexander Potapenko [Fri, 18 Jan 2013 12:31:16 +0000 (12:31 +0000)]
[ASan] Fix compilation on Mac.

llvm-svn: 172810

11 years ago[sanitizer] Fix Mac build.
Evgeniy Stepanov [Fri, 18 Jan 2013 11:38:23 +0000 (11:38 +0000)]
[sanitizer] Fix Mac build.

llvm-svn: 172809

11 years ago[ubsan] Add support for -fsanitize-blacklist
Will Dietz [Fri, 18 Jan 2013 11:30:38 +0000 (11:30 +0000)]
[ubsan] Add support for -fsanitize-blacklist

llvm-svn: 172808

11 years ago[asan] fix two off-by-one errors that seem to affect only PowerPC because only there...
Kostya Serebryany [Fri, 18 Jan 2013 11:30:36 +0000 (11:30 +0000)]
[asan] fix two off-by-one errors that seem to affect only PowerPC because only there the stack top may be equal to the address space top. Noted by Andreas Schwab in gcc.gnu.org/bugzilla/show_bug.cgi?id=55975#c11 . Also make swapcontext interceptor a bit more robust

llvm-svn: 172807

11 years agoMove Blacklist.h to include/ to enable use from clang.
Will Dietz [Fri, 18 Jan 2013 11:29:21 +0000 (11:29 +0000)]
Move Blacklist.h to include/ to enable use from clang.

llvm-svn: 172806

11 years ago[sanitizer] Common *scanf interceptors.
Evgeniy Stepanov [Fri, 18 Jan 2013 11:17:23 +0000 (11:17 +0000)]
[sanitizer] Common *scanf interceptors.

llvm-svn: 172805

11 years agoReduce penalty for splitting between ")" and ".".
Daniel Jasper [Fri, 18 Jan 2013 10:56:38 +0000 (10:56 +0000)]
Reduce penalty for splitting between ")" and ".".

').' is likely part of a builder pattern statement.
This is based upon a patch developed by Nico Weber. Thank you!

Before:
int foo() {
  return llvm::StringSwitch<Reference::Kind>(name).StartsWith(
      ".eh_frame_hdr", ORDER_EH_FRAMEHDR).StartsWith(
      ".eh_frame", ORDER_EH_FRAME).StartsWith(".init", ORDER_INIT).StartsWith(
      ".fini", ORDER_FINI).StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}

After:
int foo() {
  return llvm::StringSwitch<Reference::Kind>(name)
         .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
         .StartsWith(".eh_frame", ORDER_EH_FRAME)
         .StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
         .StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}

Probably not ideal, but makes many cases much more readable.

The changes to overriding-ftemplate-comments.cpp don't seem better or
worse. We should address those soon.

llvm-svn: 172804

11 years agoRemove references to pthread_workqueue_additem_np(), which isn't in the official...
Alexander Potapenko [Fri, 18 Jan 2013 10:27:31 +0000 (10:27 +0000)]
Remove references to pthread_workqueue_additem_np(), which isn't in the official libdispatch API.

llvm-svn: 172802

11 years agoAdd basic command line parsing to TestMain.
Manuel Klimek [Fri, 18 Jan 2013 10:18:50 +0000 (10:18 +0000)]
Add basic command line parsing to TestMain.

Summary:
This allows unit tests for components that use Support/Debug.h to print
debug information from test runs by specifying -debug when running the
test.

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D301

llvm-svn: 172801

11 years ago[ASan] fixes for Android build
Alexey Samsonov [Fri, 18 Jan 2013 09:20:06 +0000 (09:20 +0000)]
[ASan] fixes for Android build

llvm-svn: 172800

11 years agoAlso align trailing line comments in include directives.
Daniel Jasper [Fri, 18 Jan 2013 09:19:33 +0000 (09:19 +0000)]
Also align trailing line comments in include directives.

Before:
  #include <a> // for x
  #include <a/b/c> // for yz
After:
  #include <a>     // for x
  #include <a/b/c> // for yz

llvm-svn: 172799

11 years agoLet the formatter align trailing line comments where possible.
Daniel Jasper [Fri, 18 Jan 2013 08:44:07 +0000 (08:44 +0000)]
Let the formatter align trailing line comments where possible.

Before:
int a; // comment
int bbbbb; // comment

After:
int a;     // comment
int bbbbb; // comment

llvm-svn: 172798

11 years agoCalculate vector element size more directly for VINSERTF128/VEXTRACTF128 immediate...
Craig Topper [Fri, 18 Jan 2013 08:41:28 +0000 (08:41 +0000)]
Calculate vector element size more directly for VINSERTF128/VEXTRACTF128 immediate handling. Also use MVT since this only called on legal types during pattern matching.

llvm-svn: 172797

11 years agoMinor formatting fix. No functional change.
Craig Topper [Fri, 18 Jan 2013 07:27:20 +0000 (07:27 +0000)]
Minor formatting fix. No functional change.

llvm-svn: 172795

11 years agoRemove support for Tcl test format since nobody uses it
Dmitri Gribenko [Fri, 18 Jan 2013 06:57:01 +0000 (06:57 +0000)]
Remove support for Tcl test format since nobody uses it

llvm-svn: 172794

11 years agoSpelling fix: extened->extended. Trailing whitespace in same function.
Craig Topper [Fri, 18 Jan 2013 06:50:59 +0000 (06:50 +0000)]
Spelling fix: extened->extended. Trailing whitespace in same function.

llvm-svn: 172793

11 years agoMake more use of is128BitVector/is256BitVector in place of getSizeInBits() == 128...
Craig Topper [Fri, 18 Jan 2013 06:44:29 +0000 (06:44 +0000)]
Make more use of is128BitVector/is256BitVector in place of getSizeInBits() == 128/256.

llvm-svn: 172792

11 years ago[sanitizer] reapply r172719, r172721-172723, r172725, and also fix the warning on...
Kostya Serebryany [Fri, 18 Jan 2013 06:43:13 +0000 (06:43 +0000)]
[sanitizer] reapply r172719, r172721-172723, r172725, and also fix the warning on Mac.

llvm-svn: 172791

11 years agoFormatter: After case blocks, "break" goes on the same line as the "}", PR14907.
Nico Weber [Fri, 18 Jan 2013 05:50:57 +0000 (05:50 +0000)]
Formatter: After case blocks, "break" goes on the same line as the "}", PR14907.

Before:
switch (foo) {
case a: {
  int a = g();
  h(a);
}
  break;
}

Now:
switch (foo) {
case a: {
  int a = g();
  h(a);
} break;
}

llvm-svn: 172789

11 years agoCheck for less than 0 in shuffle mask instead of -1. It's more consistent with other...
Craig Topper [Fri, 18 Jan 2013 05:30:07 +0000 (05:30 +0000)]
Check for less than 0 in shuffle mask instead of -1. It's more consistent with other code related to shuffles and easier to implement in compiled code.

llvm-svn: 172788

11 years agoFormatter: Enable @encode test.
Nico Weber [Fri, 18 Jan 2013 05:11:47 +0000 (05:11 +0000)]
Formatter: Enable @encode test.

This doesn't work right with pointers to pointers, but that's likely just a
dupe of PR14884.

llvm-svn: 172785

11 years agoRemove trailing whitespace. Remove new lines between closing brace and 'else'
Craig Topper [Fri, 18 Jan 2013 05:09:16 +0000 (05:09 +0000)]
Remove trailing whitespace. Remove new lines between closing brace and 'else'

llvm-svn: 172784

11 years agoRevert Clang r172620 and r172629, which caused a hang when building
Douglas Gregor [Fri, 18 Jan 2013 04:34:14 +0000 (04:34 +0000)]
Revert Clang r172620 and r172629, which caused a hang when building
complicated modules (<rdar://problem/13038265>). Unfortunately, this
un-fixes <rdar://problem/13016031>.

llvm-svn: 172783

11 years agoFixed 80+ violation.
Michael Gottesman [Fri, 18 Jan 2013 03:08:39 +0000 (03:08 +0000)]
Fixed 80+ violation.

llvm-svn: 172782

11 years agoFormatter: The contents of @selector() should be formatted as a selector.
Nico Weber [Fri, 18 Jan 2013 02:43:57 +0000 (02:43 +0000)]
Formatter: The contents of @selector() should be formatted as a selector.

Before: @selector(foo: )
Now: @selector(foo:)
llvm-svn: 172781

11 years agoWhen checking the parameter types of an Objective-C method, don't
Douglas Gregor [Fri, 18 Jan 2013 01:41:40 +0000 (01:41 +0000)]
When checking the parameter types of an Objective-C method, don't
decay the parameter type immediately; let CheckParameter() do its
job. Fixes <rdar://problem/12071218>.

llvm-svn: 172780

11 years ago[MC/Mach-O] Add support for linker options in Mach-O files.
Daniel Dunbar [Fri, 18 Jan 2013 01:26:07 +0000 (01:26 +0000)]
[MC/Mach-O] Add support for linker options in Mach-O files.

llvm-svn: 172779

11 years ago[MC/Mach-O] Add AsmParser support for .linker_option directive.
Daniel Dunbar [Fri, 18 Jan 2013 01:25:48 +0000 (01:25 +0000)]
[MC/Mach-O] Add AsmParser support for .linker_option directive.

llvm-svn: 172778