platform/upstream/llvm.git
12 years ago<rdar://problem/10449092> Adding a new uppercase hex format specifier. This commit...
Enrico Granata [Thu, 9 Aug 2012 19:33:34 +0000 (19:33 +0000)]
<rdar://problem/10449092> Adding a new uppercase hex format specifier. This commit also changes the short names for formats so that uppercase hex can be 'X', which was previously assigned to hex float. hex float now has no short name.

llvm-svn: 161606

12 years agoIn 'delete []', the '[]' never starts a lambda. Update a FIXME with a standard refere...
Richard Smith [Thu, 9 Aug 2012 19:01:51 +0000 (19:01 +0000)]
In 'delete []', the '[]' never starts a lambda. Update a FIXME with a standard reference and add a test.

llvm-svn: 161604

12 years ago[analyzer] Improve readability of the dyn. dispatch bifurcation patch
Anna Zaks [Thu, 9 Aug 2012 18:43:00 +0000 (18:43 +0000)]
[analyzer] Improve readability of the dyn. dispatch bifurcation patch
r161552.

As per Jordan's feedback.

llvm-svn: 161603

12 years agoRemove absolute file path in test.
Dmitri Gribenko [Thu, 9 Aug 2012 18:35:49 +0000 (18:35 +0000)]
Remove absolute file path in test.

llvm-svn: 161602

12 years agoComment to HTML and XML conversion: ignore commands that contain a declaration
Dmitri Gribenko [Thu, 9 Aug 2012 18:20:29 +0000 (18:20 +0000)]
Comment to HTML and XML conversion: ignore commands that contain a declaration
as their argument.  For example, \fn, \function, \typedef, \method, \class etc.

llvm-svn: 161601

12 years agoLLDB no longer prints <no result> by default if
Sean Callanan [Thu, 9 Aug 2012 18:18:47 +0000 (18:18 +0000)]
LLDB no longer prints <no result> by default if
the expression returns nothing.  There is now a
setting, "notify-void."  When the user enables
that setting, lldb prints (void) if an expression's
result is void.  Otherwise, lldb is silent.

<rdar://problem/11225150>

llvm-svn: 161600

12 years agoFix the test case. Now it does not depend on the method used to pass vector arguments...
Simon Atanasyan [Thu, 9 Aug 2012 17:49:22 +0000 (17:49 +0000)]
Fix the test case. Now it does not depend on the method used to pass vector arguments to the function.
Reviewed by Anton Lokhmotov.

llvm-svn: 161597

12 years agoComment to HTML and XML conversion: use CommandTraits to classify commands.
Dmitri Gribenko [Thu, 9 Aug 2012 17:33:20 +0000 (17:33 +0000)]
Comment to HTML and XML conversion: use CommandTraits to classify commands.

This also fixes a bug in comment to XML conversion: \result was just an
ordinary paragraph, not an alias for \returns.

llvm-svn: 161596

12 years ago[ms-inline asm] Initialize targets and assembly printers/parsers.
Chad Rosier [Thu, 9 Aug 2012 17:33:11 +0000 (17:33 +0000)]
[ms-inline asm] Initialize targets and assembly printers/parsers.

llvm-svn: 161595

12 years ago[ms-inline asm] Add various MC components to clang build to support MS-style inline...
Chad Rosier [Thu, 9 Aug 2012 17:17:01 +0000 (17:17 +0000)]
[ms-inline asm] Add various MC components to clang build to support MS-style inline assembly.

llvm-svn: 161594

12 years agoobjective-C: minor refactoring in method
Fariborz Jahanian [Thu, 9 Aug 2012 17:15:00 +0000 (17:15 +0000)]
objective-C: minor refactoring in method
definition parsing logic.

llvm-svn: 161593

12 years ago<rdar://problem/11505459> Stripping off the object's type from the output of the...
Enrico Granata [Thu, 9 Aug 2012 16:51:25 +0000 (16:51 +0000)]
<rdar://problem/11505459> Stripping off the object's type from the output of the 'po' command

llvm-svn: 161592

12 years agoAdd a test checking that all the "__asan_" interface functions are present in a binar...
Alexander Potapenko [Thu, 9 Aug 2012 16:05:17 +0000 (16:05 +0000)]
Add a test checking that all the "__asan_" interface functions are present in a binary built with -dead_strip.
Fix force_interface_symbols() so that none of the interface symbols is stripped.

llvm-svn: 161582

12 years agoPatch to implement UMLAL/SMLAL instructions for the ARM architecture
Arnold Schwaighofer [Thu, 9 Aug 2012 15:25:52 +0000 (15:25 +0000)]
Patch to implement UMLAL/SMLAL instructions for the ARM architecture

This patch corrects the definition of umlal/smlal instructions and adds support
for matching them to the ARM dag combiner.

Bug 12213

Patch by Yin Ma!

llvm-svn: 161581

12 years agoMake the non-interface mach_override functions static to avoid name clashes with...
Alexander Potapenko [Thu, 9 Aug 2012 13:33:02 +0000 (13:33 +0000)]
Make the non-interface mach_override functions static to avoid name clashes with user code that may contain its own mach_override.

llvm-svn: 161577

12 years ago[ASan] Move mac-specific error reports to asan_report.cc as well
Alexey Samsonov [Thu, 9 Aug 2012 12:15:40 +0000 (12:15 +0000)]
[ASan] Move mac-specific error reports to asan_report.cc as well

llvm-svn: 161576

12 years ago[ASan] Small fix to please tests on Windows, where stack unwinding using provided...
Alexey Samsonov [Thu, 9 Aug 2012 11:29:13 +0000 (11:29 +0000)]
[ASan] Small fix to please tests on Windows, where stack unwinding using provided pc/bp works too bad

llvm-svn: 161575

12 years ago[ASan] Move __asan_report_error implementation to asan_report.cc
Alexey Samsonov [Thu, 9 Aug 2012 10:56:57 +0000 (10:56 +0000)]
[ASan] Move __asan_report_error implementation to asan_report.cc

llvm-svn: 161574

12 years agoUse a switch instead of a simple condition in force_interface_symbols().
Alexander Potapenko [Thu, 9 Aug 2012 09:46:12 +0000 (09:46 +0000)]
Use a switch instead of a simple condition in force_interface_symbols().
Otherwise Clang eliminates everything after the first interface symbol that is marked noreturn.

llvm-svn: 161573

12 years ago[ASan] move code that describes globals to asan_report.cc
Alexey Samsonov [Thu, 9 Aug 2012 09:27:24 +0000 (09:27 +0000)]
[ASan] move code that describes globals to asan_report.cc

llvm-svn: 161572

12 years ago[ASan] move some functions that describe addresses to asan_report.cc
Alexey Samsonov [Thu, 9 Aug 2012 09:06:52 +0000 (09:06 +0000)]
[ASan] move some functions that describe addresses to asan_report.cc

llvm-svn: 161571

12 years ago[ASan] Move error reporting code away from file with interceptors
Alexey Samsonov [Thu, 9 Aug 2012 08:32:33 +0000 (08:32 +0000)]
[ASan] Move error reporting code away from file with interceptors

llvm-svn: 161570

12 years ago[ASan] Move error reports away from ASan allocator. Add new source file to CMakeLists...
Alexey Samsonov [Thu, 9 Aug 2012 08:15:46 +0000 (08:15 +0000)]
[ASan] Move error reports away from ASan allocator. Add new source file to CMakeLists as well

llvm-svn: 161569

12 years ago[ASan] Create new files asan_report.{h,cc} as a preparation for refactoring of ASan...
Alexey Samsonov [Thu, 9 Aug 2012 07:40:58 +0000 (07:40 +0000)]
[ASan] Create new files asan_report.{h,cc} as a preparation for refactoring of ASan error reporting code.
Currently ASan reports many kinds of errors, and the code that actually prints error messages can
be found inside allocator, OS-specific files, interceptors code etc.

An example of maintenance troubles this situation causes:
There is currently an ASan interface function that registers
callback which should take the char buffer with error report printed by ASan.
This function is now broken, as one has to insert callback calls to all the places in
ASan code where the error reports are printed, surprisingly it is not only
"__asan_report_error" function...

llvm-svn: 161568

12 years agoUnbreak the build.
Anna Zaks [Thu, 9 Aug 2012 02:57:02 +0000 (02:57 +0000)]
Unbreak the build.

Declaring "const Decl *Decl" is not a good idea.

llvm-svn: 161567

12 years agoFix the legalization of ExtLoad on ARM. ExpandUnalignedLoad did not properly
Nadav Rotem [Thu, 9 Aug 2012 01:56:44 +0000 (01:56 +0000)]
Fix the legalization of ExtLoad on ARM.  ExpandUnalignedLoad did not properly
handle the cases where the memory value type was illegal.
PR 13111.

llvm-svn: 161565

12 years agoThis field isn't used anymore, use it with HWEncoding instead.
Eric Christopher [Thu, 9 Aug 2012 01:39:32 +0000 (01:39 +0000)]
This field isn't used anymore, use it with HWEncoding instead.

llvm-svn: 161564

12 years agollvm.zip rebuilt with libc++ for Mac OS X.
Sean Callanan [Thu, 9 Aug 2012 01:33:24 +0000 (01:33 +0000)]
llvm.zip rebuilt with libc++ for Mac OS X.

<rdar://problem/11930775>

llvm-svn: 161563

12 years agoOn Mac OS X, lldb will now build c++11 and use
Sean Callanan [Thu, 9 Aug 2012 01:32:13 +0000 (01:32 +0000)]
On Mac OS X, lldb will now build c++11 and use
libc++.  We also no longer use the GNU extensions
to C++ and C (we didn't use them anyway).

This also means that the LLVM we use must be
built with the new libc++.

I will commit llvm.zip next.

<rdar://problem/11930775>

llvm-svn: 161562

12 years agoSupport for experimental targets
Victor Oliveira [Thu, 9 Aug 2012 01:13:59 +0000 (01:13 +0000)]
Support for experimental targets

Added LLVM_EXPERIMENTAL_TARGETS_TO_BUILD in CMake and --enable-experimental-targets in configure.

llvm-svn: 161561

12 years agoMade lldb.swig include <string>, which it requires.
Sean Callanan [Thu, 9 Aug 2012 00:53:54 +0000 (00:53 +0000)]
Made lldb.swig include <string>, which it requires.

llvm-svn: 161560

12 years agoRemoved explicit NULL checks for shared pointers
Sean Callanan [Thu, 9 Aug 2012 00:50:26 +0000 (00:50 +0000)]
Removed explicit NULL checks for shared pointers
and instead made us use implicit casts to bool.
This generated a warning in C++11.

<rdar://problem/11930775>

llvm-svn: 161559

12 years agoWhen compiling with C++11, switch from
Sean Callanan [Thu, 9 Aug 2012 00:46:55 +0000 (00:46 +0000)]
When compiling with C++11, switch from
hash_multimap to unordered_multimap.

<rdar://problem/11930775>

llvm-svn: 161558

12 years ago[analyzer] Cleanup of malloc checker.
Anna Zaks [Thu, 9 Aug 2012 00:42:24 +0000 (00:42 +0000)]
[analyzer] Cleanup of malloc checker.

Remove Escaped state, which is not really necessary. We can just stop
tracking the symbol instead of keeping it around and marking escaped.

llvm-svn: 161557

12 years agoNow that the testcase is fixed, it is no longer
Sean Callanan [Thu, 9 Aug 2012 00:40:16 +0000 (00:40 +0000)]
Now that the testcase is fixed, it is no longer
an expected failure.

llvm-svn: 161556

12 years ago<rdar://problem/12061386> Fixing data-formatter-cpp test case - previous version...
Enrico Granata [Thu, 9 Aug 2012 00:35:41 +0000 (00:35 +0000)]
<rdar://problem/12061386> Fixing data-formatter-cpp test case - previous version had an unfortunate dependency on the value of uninitialized memory

llvm-svn: 161555

12 years agoFix AAPCS ABI. I can't actually test this, but it restores the behavior from before...
Eli Friedman [Thu, 9 Aug 2012 00:31:40 +0000 (00:31 +0000)]
Fix AAPCS ABI.  I can't actually test this, but it restores the behavior from before r159168.  PR13562.

llvm-svn: 161554

12 years agoMachineRegisterInfo was already a friend of MachineOperand, and GCC complains
Matt Beaumont-Gay [Thu, 9 Aug 2012 00:30:39 +0000 (00:30 +0000)]
MachineRegisterInfo was already a friend of MachineOperand, and GCC complains
about repeated friending.

llvm-svn: 161553

12 years ago[analyzer] Bifurcate the path with dynamic dispatch.
Anna Zaks [Thu, 9 Aug 2012 00:21:33 +0000 (00:21 +0000)]
[analyzer] Bifurcate the path with dynamic dispatch.

This is an initial (unoptimized) version. We split the path when
inlining ObjC instance methods. On one branch we always assume that the
type information for the given memory region is precise. On the other we
assume that we don't have the exact type info. It is important to check
since the class could be subclassed and the method can be overridden. If
we always inline we can loose coverage.

Had to refactor some of the call eval functions.

llvm-svn: 161552

12 years agoAdd new file CommentCommandTraits.cpp to CMakeLists.txt.
Dmitri Gribenko [Thu, 9 Aug 2012 00:16:26 +0000 (00:16 +0000)]
Add new file CommentCommandTraits.cpp to CMakeLists.txt.

llvm-svn: 161551

12 years agoFix the order of the link arguments for this tool. I think there is
Chandler Carruth [Thu, 9 Aug 2012 00:12:21 +0000 (00:12 +0000)]
Fix the order of the link arguments for this tool. I think there is
something fishy with the rest of the order too, but this at least lets
it build for me.

llvm-svn: 161550

12 years agoAllow the Makefile build system to find the extra repo if it is checked
Chandler Carruth [Thu, 9 Aug 2012 00:05:27 +0000 (00:05 +0000)]
Allow the Makefile build system to find the extra repo if it is checked
out.

Unfortunately, the existing makefiles for the extra repo don't specify
the correct library dependencies. Fixing that next. If you're following
along, you'll get linker errors.

llvm-svn: 161549

12 years agoComment parsing: extract TableGen'able pieces into new CommandTraits class.
Dmitri Gribenko [Thu, 9 Aug 2012 00:03:17 +0000 (00:03 +0000)]
Comment parsing: extract TableGen'able pieces into new CommandTraits class.

llvm-svn: 161548

12 years agoThe C++ data formatter tests are flaky. Marking
Sean Callanan [Thu, 9 Aug 2012 00:01:48 +0000 (00:01 +0000)]
The C++ data formatter tests are flaky.  Marking
them as expected failures until they are fixed.

llvm-svn: 161547

12 years agoclang support for Bitrig (an OpenBSD fork); patch by David Hill.
Eli Friedman [Wed, 8 Aug 2012 23:57:20 +0000 (23:57 +0000)]
clang support for Bitrig (an OpenBSD fork); patch by David Hill.

llvm-svn: 161546

12 years agoMove [SU]LEB128 encoding to a utility header.
Jim Grosbach [Wed, 8 Aug 2012 23:56:06 +0000 (23:56 +0000)]
Move [SU]LEB128 encoding to a utility header.

These functions are very generic. There's no reason for them to
be tied to MCObjectWriter.

llvm-svn: 161545

12 years agoMinor simplification for r161534.
Eli Friedman [Wed, 8 Aug 2012 23:53:27 +0000 (23:53 +0000)]
Minor simplification for r161534.

llvm-svn: 161544

12 years agoMove getNextOperandForReg() into MachineRegisterInfo.
Jakob Stoklund Olesen [Wed, 8 Aug 2012 23:44:07 +0000 (23:44 +0000)]
Move getNextOperandForReg() into MachineRegisterInfo.

MRI provides iterators for traversing the use-def chains. They should
not be accessible from anywhere else.

llvm-svn: 161543

12 years agoDon't use getNextOperandForReg().
Jakob Stoklund Olesen [Wed, 8 Aug 2012 23:44:04 +0000 (23:44 +0000)]
Don't use getNextOperandForReg().

This way of using getNextOperandForReg() was unlikely to work as
intended. We don't give any guarantees about the order of operands in
the use-def chains, so looking only at operands following a given
operand in the chain doesn't make sense.

llvm-svn: 161542

12 years agoDon't use getNextOperandForReg() in RAFast.
Jakob Stoklund Olesen [Wed, 8 Aug 2012 23:44:01 +0000 (23:44 +0000)]
Don't use getNextOperandForReg() in RAFast.

That particular optimization was probably premature anyway.

llvm-svn: 161541

12 years agoobjective-C: refactor/simplify parsing of delayed
Fariborz Jahanian [Wed, 8 Aug 2012 23:41:08 +0000 (23:41 +0000)]
objective-C: refactor/simplify parsing of delayed
method/c-funcs defined in objc class implementation.
No intended functionality change.

llvm-svn: 161540

12 years agoFix r161534 so it actually builds.
Eli Friedman [Wed, 8 Aug 2012 23:35:12 +0000 (23:35 +0000)]
Fix r161534 so it actually builds.

llvm-svn: 161539

12 years agoFix up the makefiles in the tools repo, and add a top-level makefile
Chandler Carruth [Wed, 8 Aug 2012 23:34:47 +0000 (23:34 +0000)]
Fix up the makefiles in the tools repo, and add a top-level makefile
suitable for building as part of the LLVM/Clang build.

llvm-svn: 161538

12 years agoPR13558: Fix typo 'compatiblity'. Thinking of the children. Apparently.
Richard Smith [Wed, 8 Aug 2012 23:32:13 +0000 (23:32 +0000)]
PR13558: Fix typo 'compatiblity'. Thinking of the children. Apparently.

llvm-svn: 161537

12 years agoAllow legalization of target-specific SDNodes, provided that the target itself provid...
Owen Anderson [Wed, 8 Aug 2012 23:31:14 +0000 (23:31 +0000)]
Allow legalization of target-specific SDNodes, provided that the target itself provide a legalization hook for them.

llvm-svn: 161536

12 years agoHandle deprecation diagnostics correctly for C struct fields and Objective-C properti...
Eli Friedman [Wed, 8 Aug 2012 23:04:35 +0000 (23:04 +0000)]
Handle deprecation diagnostics correctly for C struct fields and Objective-C properties/ivars. <rdar://problem/6642337>.

llvm-svn: 161534

12 years agoFixed the delay that was happening when quitting lldb from the command line. We weren...
Greg Clayton [Wed, 8 Aug 2012 22:27:52 +0000 (22:27 +0000)]
Fixed the delay that was happening when quitting lldb from the command line. We weren't initializing the command pipes when constructing a ConnectionFileDescriptor with a file descriptor.

llvm-svn: 161533

12 years agoDeal with irreducible control flow when building traces.
Jakob Stoklund Olesen [Wed, 8 Aug 2012 22:12:01 +0000 (22:12 +0000)]
Deal with irreducible control flow when building traces.

We filter out MachineLoop back-edges during the trace-building PO
traversals, but it is possible to have CFG cycles that aren't natural
loops, and MachineLoopInfo doesn't include such cycles.

Use a standard visited set to detect such CFG cycles, and completely
ignore them when picking traces.

llvm-svn: 161532

12 years agoComment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy does
Dmitri Gribenko [Wed, 8 Aug 2012 22:10:24 +0000 (22:10 +0000)]
Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy does
not compress spaces in verbatim content.

llvm-svn: 161531

12 years agoRemove some coding violations. No functionality change.
Bill Wendling [Wed, 8 Aug 2012 22:03:50 +0000 (22:03 +0000)]
Remove some coding violations. No functionality change.

llvm-svn: 161530

12 years agoCache a commonly used reference.
Bill Wendling [Wed, 8 Aug 2012 22:01:55 +0000 (22:01 +0000)]
Cache a commonly used reference.

llvm-svn: 161529

12 years agoUnify the codepaths for emitting deprecation warnings. The test changes are just...
Eli Friedman [Wed, 8 Aug 2012 21:52:41 +0000 (21:52 +0000)]
Unify the codepaths for emitting deprecation warnings.  The test changes are just to account for us emitting notes more consistently.

llvm-svn: 161528

12 years agoAddress code review comments for Wstrncat-size warning (r161440).
Anna Zaks [Wed, 8 Aug 2012 21:42:23 +0000 (21:42 +0000)]
Address code review comments for Wstrncat-size warning (r161440).

llvm-svn: 161527

12 years ago[ms-inline asm] Use more idiomatic logic. Thanks, Bill.
Chad Rosier [Wed, 8 Aug 2012 21:42:11 +0000 (21:42 +0000)]
[ms-inline asm] Use more idiomatic logic.  Thanks, Bill.

llvm-svn: 161526

12 years agoImplicitly annotate __CFStringMakeConstantString with format_arg(1).
Jordan Rose [Wed, 8 Aug 2012 21:17:31 +0000 (21:17 +0000)]
Implicitly annotate __CFStringMakeConstantString with format_arg(1).

We handled the builtin version of this function in r157968, but the builtin
isn't used when compiling as -fno-constant-cfstrings.

This should complete <rdar://problem/6157200>.

llvm-svn: 161525

12 years ago[ms-inline asm] Add basic codegen support for simple asm stmts. Currently,
Chad Rosier [Wed, 8 Aug 2012 21:15:52 +0000 (21:15 +0000)]
[ms-inline asm] Add basic codegen support for simple asm stmts.  Currently,
only machine specific clobbers are modeled.

llvm-svn: 161524

12 years agoDon't add attributes for "#pragma pack" and friends to tag declarations which
Eli Friedman [Wed, 8 Aug 2012 21:08:34 +0000 (21:08 +0000)]
Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531.  <rdar://problem/12048621>.

llvm-svn: 161523

12 years ago[ms-inline asm] Make sure IsSimple is correctly handled.
Chad Rosier [Wed, 8 Aug 2012 21:08:20 +0000 (21:08 +0000)]
[ms-inline asm] Make sure IsSimple is correctly handled.

llvm-svn: 161522

12 years agoRemove extraneous comment.
Chad Rosier [Wed, 8 Aug 2012 20:38:22 +0000 (20:38 +0000)]
Remove extraneous comment.

llvm-svn: 161521

12 years ago[ms-inline asm] Add a very simple test case. Basically, we're only testing for
Chad Rosier [Wed, 8 Aug 2012 20:37:31 +0000 (20:37 +0000)]
[ms-inline asm] Add a very simple test case.  Basically, we're only testing for
crashers at the moment (and coincidentally this case was causing a crash).

llvm-svn: 161520

12 years agoAdd test triples to fix win32 failures. Revert workaround from r161292.
Bob Wilson [Wed, 8 Aug 2012 20:31:37 +0000 (20:31 +0000)]
Add test triples to fix win32 failures.  Revert workaround from r161292.

I don't have a win32 system to test, so hopefully I got them all fixed here.

llvm-svn: 161519

12 years ago[ms-inline asm] Refactor the logic to generate the AsmString into Sema. No
Chad Rosier [Wed, 8 Aug 2012 19:48:07 +0000 (19:48 +0000)]
[ms-inline asm] Refactor the logic to generate the AsmString into Sema.  No
functional change intended.

llvm-svn: 161518

12 years agoWhitespace.
Chad Rosier [Wed, 8 Aug 2012 18:51:50 +0000 (18:51 +0000)]
Whitespace.

llvm-svn: 161517

12 years agoWhitespace.
Chad Rosier [Wed, 8 Aug 2012 18:46:20 +0000 (18:46 +0000)]
Whitespace.

llvm-svn: 161516

12 years agoRemove OpenBSD defines:
Bill Wendling [Wed, 8 Aug 2012 18:37:39 +0000 (18:37 +0000)]
Remove OpenBSD defines:

- The defines are in stddint.h, which is #include'd already.
- The block wasn't used anyway, since it was _OpenBSD_, and not __OpenBSD__

Patch by David Hill!

llvm-svn: 161515

12 years agoAdd a copy of the LLVM license here so that even a stand-alone checkout
Chandler Carruth [Wed, 8 Aug 2012 18:30:15 +0000 (18:30 +0000)]
Add a copy of the LLVM license here so that even a stand-alone checkout
includes the proper license text.

llvm-svn: 161514

12 years agoHeed -stress-early-ifcvt.
Jakob Stoklund Olesen [Wed, 8 Aug 2012 18:24:23 +0000 (18:24 +0000)]
Heed -stress-early-ifcvt.

llvm-svn: 161513

12 years ago[analyzer] Clean up the printing of FieldRegions for leaks.
Jordan Rose [Wed, 8 Aug 2012 18:23:36 +0000 (18:23 +0000)]
[analyzer] Clean up the printing of FieldRegions for leaks.

Unfortunately, generalized region printing is very difficult:
- ElementRegions are used both for casting and as actual elements.
- Accessing values through a pointer means going through an intermediate
  SymbolRegionValue; symbolic regions are untyped.
- Referring to implicitly-defined variables like 'this' and 'self' could be
  very confusing if they come from another stack frame.

We fall back to simply not printing the region name if we can't be sure it
will print well. This will allow us to improve in the future.

llvm-svn: 161512

12 years ago[analyzer] Track malloc'd regions stored in structs.
Jordan Rose [Wed, 8 Aug 2012 18:23:31 +0000 (18:23 +0000)]
[analyzer] Track malloc'd regions stored in structs.

The main blocker on this (besides the previous commit) was that
ScanReachableSymbols was not looking through LazyCompoundVals.
Once that was fixed, it's easy enough to clear out malloc data on return,
just like we do when we bind to a global region.

<rdar://problem/10872635>

llvm-svn: 161511

12 years ago[analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.
Jordan Rose [Wed, 8 Aug 2012 18:23:27 +0000 (18:23 +0000)]
[analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.

RegionStore currently uses a (Region, Offset) pair to describe the locations
of memory bindings. However, this representation breaks down when we have
regions like 'array[index]', where 'index' is unknown. We used to store this
as (SubRegion, 0); now we mark them specially as (SubRegion, SYMBOLIC).

Furthermore, ProgramState::scanReachableSymbols depended on the existence of
a sub-region map, but RegionStore's implementation doesn't provide for such
a thing. Moving the store-traversing logic of scanReachableSymbols into the
StoreManager allows us to eliminate the notion of SubRegionMap altogether.

This fixes some particularly awkward broken test cases, now in
array-struct-region.c.

llvm-svn: 161510

12 years agoConstify CXXRecordDecl::isVirtuallyDerivedFrom.
Jordan Rose [Wed, 8 Aug 2012 18:23:20 +0000 (18:23 +0000)]
Constify CXXRecordDecl::isVirtuallyDerivedFrom.

No functionality change. A couple ugly const_casts because the ancestor
search code is used for other purposes as well.

llvm-svn: 161509

12 years ago[ms-inline asm] Add support for detecting simple ms-style inline asm. Simple
Chad Rosier [Wed, 8 Aug 2012 18:22:06 +0000 (18:22 +0000)]
[ms-inline asm] Add support for detecting simple ms-style inline asm.  Simple
asm statements are those that don't reference variable names, function names,
and labels.

Add logic to generate a patched AsmString that will eventually be consumed by
the AsmParser.  No functional change at this point, so unfortunately no test
case.

llvm-svn: 161508

12 years agoGet the MispredictPenalty from MCSchedModel.
Jakob Stoklund Olesen [Wed, 8 Aug 2012 18:19:58 +0000 (18:19 +0000)]
Get the MispredictPenalty from MCSchedModel.

Thanks, Andy!

llvm-svn: 161507

12 years agoReplace the stub README with a proper one based on Clang's.
Chandler Carruth [Wed, 8 Aug 2012 18:16:41 +0000 (18:16 +0000)]
Replace the stub README with a proper one based on Clang's.

Also test the commit hooks for the new repository.

llvm-svn: 161506

12 years agorevert my previous patch
Sebastian Pop [Wed, 8 Aug 2012 18:04:45 +0000 (18:04 +0000)]
revert my previous patch

llvm-svn: 161505

12 years agoenable Hexagon target from cmake
Sebastian Pop [Wed, 8 Aug 2012 17:45:43 +0000 (17:45 +0000)]
enable Hexagon target from cmake

This patch allows us to use cmake to specify a cross compiler for Hexagon.

In particular, the patch adds a missing case for the target Hexagon in
cmake/config-ix.cmake, and it moves LLVM_DEFAULT_TARGET_TRIPLE and TARGET_TRIPLE
variables from cmake/config-ix.cmake to the toplevel CMakeLists.txt to make them
available at configure time. Here is the command line that I have used to test
my patches:

$ cmake -G Ninja -D BUILD_SHARED_LIBS:BOOL=ON -D LLVM_TARGETS_TO_BUILD:STRING=Hexagon -D TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_DEFAULT_TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_TARGET_ARCH:STRING=hexagon-unknown-linux-gnu -D LLVM_ENABLE_PIC:BOOL=OFF ..
$ ninja check

llvm-svn: 161504

12 years agoAdd the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.
Chad Rosier [Wed, 8 Aug 2012 17:35:36 +0000 (17:35 +0000)]
Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.

llvm-svn: 161503

12 years agoAdded a 'void' format so that the user can manually
Sean Callanan [Wed, 8 Aug 2012 17:35:10 +0000 (17:35 +0000)]
Added a 'void' format so that the user can manually
suppress all non-error output from the "expression"
command.

<rdar://problem/11225150>

llvm-svn: 161502

12 years agoImplement warning for integral null pointer constants other than the literal 0.
David Blaikie [Wed, 8 Aug 2012 17:33:31 +0000 (17:33 +0000)]
Implement warning for integral null pointer constants other than the literal 0.

This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

llvm-svn: 161501

12 years agoobjc: Include all types when issuing warning under
Fariborz Jahanian [Wed, 8 Aug 2012 16:41:04 +0000 (16:41 +0000)]
objc: Include all types when issuing warning under
-Wdirect-ivar-access.

llvm-svn: 161500

12 years agoAdd various MC components to clang build to support MS-style inline assembly.
Chad Rosier [Wed, 8 Aug 2012 16:27:29 +0000 (16:27 +0000)]
Add various MC components to clang build to support MS-style inline assembly.

llvm-svn: 161498

12 years agoChange size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for...
Howard Hinnant [Wed, 8 Aug 2012 16:17:31 +0000 (16:17 +0000)]
Change size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for 64 bit targets.  This is controls the data layout of all exceptions defined in <stdexcept>.  This aligns the ABI with that of gcc-4.2.

llvm-svn: 161497

12 years agoChange size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for...
Howard Hinnant [Wed, 8 Aug 2012 16:15:16 +0000 (16:15 +0000)]
Change size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for 64 bit targets.  This is controls the data layout of all exceptions defined in <stdexcept>.  This aligns the ABI with that of gcc-4.2.

llvm-svn: 161496

12 years agoPreprocessor: fix __OPTIMIZE_SIZE__ and -Oz
Dylan Noblesmith [Wed, 8 Aug 2012 16:09:15 +0000 (16:09 +0000)]
Preprocessor: fix  __OPTIMIZE_SIZE__ and -Oz

Add some tests for __OPTIMIZE_SIZE__ and  __NO_INLINE__,
removing the superfluous copies in the target-specific
tests, since it's target-independent.

This uncovered a bug in the handling of -Oz: it would
attempt to store the value 2 in the 1-bit bitfield OptimizeSize,
leaving a value of 0 and never defining __OPTIMIZE_SIZE__.

llvm-svn: 161495

12 years agoFrontend: further document __BYTE_ORDER__
Dylan Noblesmith [Wed, 8 Aug 2012 16:09:12 +0000 (16:09 +0000)]
Frontend: further document __BYTE_ORDER__

llvm-svn: 161494

12 years agoIndentation fix for dotest.py.
Filipe Cabecinhas [Wed, 8 Aug 2012 15:23:24 +0000 (15:23 +0000)]
Indentation fix for dotest.py.

llvm-svn: 161493

12 years agoMake dotest.py runnable from a directory other than lldb/test
Filipe Cabecinhas [Wed, 8 Aug 2012 15:05:04 +0000 (15:05 +0000)]
Make dotest.py runnable from a directory other than lldb/test

llvm-svn: 161492

12 years agoTypedefs and indentation fixes from the Andy Zhang/PAX macro argument patch.
Rafael Espindola [Wed, 8 Aug 2012 14:51:03 +0000 (14:51 +0000)]
Typedefs and indentation fixes from the Andy Zhang/PAX macro argument patch.
Committing it first as it makes the "real" patch a lot easier to read.

llvm-svn: 161491

12 years agollvm/test/MC/COFF/seh.s: Fixup corresponding to r161487.
NAKAMURA Takumi [Wed, 8 Aug 2012 13:27:04 +0000 (13:27 +0000)]
llvm/test/MC/COFF/seh.s: Fixup corresponding to r161487.

llvm-svn: 161489

12 years agoFix for .pdata and .xdata section attributes on COFF.
Anton Korobeynikov [Wed, 8 Aug 2012 12:46:46 +0000 (12:46 +0000)]
Fix for .pdata and .xdata section attributes on COFF.
Patch by kai@redstar.de !

llvm-svn: 161487