platform/upstream/llvm.git
11 years agoFix exception handling line table problems introduced by r173593
David Blaikie [Fri, 1 Feb 2013 19:09:49 +0000 (19:09 +0000)]
Fix exception handling line table problems introduced by r173593

r173593 made us a little too eager to associate all code at the end of a
function with the user-written 'return' line. This caused problems with
breakpoints as they'd be set in exception handling code preceeding the
actual non-exception return handling code, leading to the breakpoint never
being hit in non-exceptional execution.

This change restores the pre-r173593 exception handling line information where
the cleanup code is associated with the '}' not the return line.

llvm-svn: 174206

11 years agoFix misplaced 'break'.
Jim Grosbach [Fri, 1 Feb 2013 18:57:06 +0000 (18:57 +0000)]
Fix misplaced 'break'.

llvm-svn: 174205

11 years agoAdd -mqpx and -mno-qpx feature flags to toggle use of the PPC QPX vector instruction set
Hal Finkel [Fri, 1 Feb 2013 18:44:19 +0000 (18:44 +0000)]
Add -mqpx and -mno-qpx feature flags to toggle use of the PPC QPX vector instruction set

I've renamed the altivec test to ppc-features (because now there is more than one feature to test).

llvm-svn: 174204

11 years ago[driver] Don't try to generate diagnostic information for dsymutil crashes.
Chad Rosier [Fri, 1 Feb 2013 18:30:26 +0000 (18:30 +0000)]
[driver] Don't try to generate diagnostic information for dsymutil crashes.
Part of rdar://13134273

llvm-svn: 174203

11 years agoMicro change: moved '{' for better readability (+don't confuse -Wimplicit-fallthrough)
Alexander Kornienko [Fri, 1 Feb 2013 18:28:04 +0000 (18:28 +0000)]
Micro change: moved '{' for better readability (+don't confuse -Wimplicit-fallthrough)

llvm-svn: 174202

11 years agoFix indent
Dmitri Gribenko [Fri, 1 Feb 2013 18:18:00 +0000 (18:18 +0000)]
Fix indent

llvm-svn: 174201

11 years agoremove duplicate strings from the string table
Shankar Easwaran [Fri, 1 Feb 2013 18:06:15 +0000 (18:06 +0000)]
remove duplicate strings from the string table

llvm-svn: 174200

11 years agoadd alignment to .got/.got.plt/.plt sections & fix tests
Shankar Easwaran [Fri, 1 Feb 2013 18:03:32 +0000 (18:03 +0000)]
add alignment to .got/.got.plt/.plt sections & fix tests

llvm-svn: 174199

11 years agoUse a continue to simplify loop and reduce indentation. No functional change.
Chad Rosier [Fri, 1 Feb 2013 17:49:07 +0000 (17:49 +0000)]
Use a continue to simplify loop and reduce indentation. No functional change.

llvm-svn: 174198

11 years agoFix comments: these are not trailing comments
Dmitri Gribenko [Fri, 1 Feb 2013 17:25:11 +0000 (17:25 +0000)]
Fix comments: these are not trailing comments

llvm-svn: 174197

11 years agoHexagon: Test case to confirm generation of indexed loads with zero offset.
Jyotsna Verma [Fri, 1 Feb 2013 16:40:06 +0000 (16:40 +0000)]
Hexagon: Test case to confirm generation of indexed loads with zero offset.

llvm-svn: 174196

11 years agolibclang: document the purpose of createNull()
Dmitri Gribenko [Fri, 1 Feb 2013 16:38:41 +0000 (16:38 +0000)]
libclang: document the purpose of createNull()

llvm-svn: 174195

11 years agolibclang: add comments for CXStringFlag
Dmitri Gribenko [Fri, 1 Feb 2013 16:36:31 +0000 (16:36 +0000)]
libclang: add comments for CXStringFlag

llvm-svn: 174194

11 years agoReplace LDriu*[bhdw]_indexed_V4 instructions with "def Pats".
Jyotsna Verma [Fri, 1 Feb 2013 16:36:16 +0000 (16:36 +0000)]
Replace LDriu*[bhdw]_indexed_V4 instructions with "def Pats".

llvm-svn: 174193

11 years ago[modules] Introduce ModuleFile::DirectImportLoc which is the source location
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:14 +0000 (16:36 +0000)]
[modules] Introduce ModuleFile::DirectImportLoc which is the source location
where the module was explicitly or implicitly imported in the local translation unit.

llvm-svn: 174192

11 years agoFor ModuleLoader::makeModuleVisible() also pass the source location where the
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:12 +0000 (16:36 +0000)]
For ModuleLoader::makeModuleVisible() also pass the source location where the
module import occurred.

llvm-svn: 174191

11 years agoIntroduce SourceManager::PredefinesFileID, to allow each checking of whether
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:07 +0000 (16:36 +0000)]
Introduce SourceManager::PredefinesFileID, to allow each checking of whether
a source location came from the predefines buffer.

llvm-svn: 174190

11 years ago[Sanitizer] use u32 instead of mode_t, which is defined in Darwin headers
Alexey Samsonov [Fri, 1 Feb 2013 16:32:18 +0000 (16:32 +0000)]
[Sanitizer] use u32 instead of mode_t, which is defined in Darwin headers

llvm-svn: 174189

11 years ago[ASan] remove debug output from the test
Alexey Samsonov [Fri, 1 Feb 2013 16:06:25 +0000 (16:06 +0000)]
[ASan] remove debug output from the test

llvm-svn: 174188

11 years ago[Sanitizer] make internal_open have the same interface as libc version
Alexey Samsonov [Fri, 1 Feb 2013 15:58:46 +0000 (15:58 +0000)]
[Sanitizer] make internal_open have the same interface as libc version

llvm-svn: 174187

11 years agoAdd appropriate TSFlags to the instructions that must be always extended.
Jyotsna Verma [Fri, 1 Feb 2013 15:54:43 +0000 (15:54 +0000)]
Add appropriate TSFlags to the instructions that must be always extended.

llvm-svn: 174186

11 years agoAdd check for @foo
Bill Schmidt [Fri, 1 Feb 2013 15:52:51 +0000 (15:52 +0000)]
Add check for @foo

llvm-svn: 174185

11 years agotsan: catch races on fd in more cases
Dmitry Vyukov [Fri, 1 Feb 2013 15:52:35 +0000 (15:52 +0000)]
tsan: catch races on fd in more cases

llvm-svn: 174184

11 years agoFix a string not seen without asserts
Bill Schmidt [Fri, 1 Feb 2013 15:41:02 +0000 (15:41 +0000)]
Fix a string not seen without asserts

llvm-svn: 174183

11 years agoFixed segmentation fault when a CFGBlock has NULL successor.
Alexander Kornienko [Fri, 1 Feb 2013 15:39:20 +0000 (15:39 +0000)]
Fixed segmentation fault when a CFGBlock has NULL successor.

llvm-svn: 174182

11 years agoFix PR14881 by implementing conversion rules between int and complex int.
Bill Schmidt [Fri, 1 Feb 2013 15:34:29 +0000 (15:34 +0000)]
Fix PR14881 by implementing conversion rules between int and complex int.

Prior to the patch, Clang does not properly promote types when a complex
integer operand is combined with an integer via a binary operator, or when
one is assigned to the other in either order.  This patch detects when
promotion is needed (and permissible) and generates the necessary code.

The test assmes no target has the same size operands for "char" and
"long long," and that no target performs arithmetic on char operands without
extending them to a larger format first.  If there are any targets for
which this is not the case, they should be XFAILed.

llvm-svn: 174181

11 years ago[TSan] remove artifacts from gotsan build in 'make clean' command
Alexey Samsonov [Fri, 1 Feb 2013 15:30:36 +0000 (15:30 +0000)]
[TSan] remove artifacts from gotsan build in 'make clean' command

llvm-svn: 174180

11 years agoInstSimplify: stripAndComputeConstantOffsets can be called with vectors of pointers...
Benjamin Kramer [Fri, 1 Feb 2013 15:21:10 +0000 (15:21 +0000)]
InstSimplify: stripAndComputeConstantOffsets can be called with vectors of pointers too.

Prepare it for vectors of pointers and handle simple cases. We don't handle
complicated cases because accumulateConstantOffset bails on pointer vectors.
Fixes selfhost on i386.

llvm-svn: 174179

11 years agoadd proper copyright header
Shankar Easwaran [Fri, 1 Feb 2013 15:05:11 +0000 (15:05 +0000)]
add proper copyright header

llvm-svn: 174178

11 years agoRemove currently unused register decoder from AArch64.
Tim Northover [Fri, 1 Feb 2013 14:55:05 +0000 (14:55 +0000)]
Remove currently unused register decoder from AArch64.

This should fix a warning when building this backend.

llvm-svn: 174177

11 years agoRevise unit testing for -fno-altivec, -mno-altivec.
Bill Schmidt [Fri, 1 Feb 2013 14:45:29 +0000 (14:45 +0000)]
Revise unit testing for -fno-altivec, -mno-altivec.

As suggested, reverted the end-to-end test and added variations to an
existing Driver test.

llvm-svn: 174176

11 years agotsan: even if races between atomic and plain memory accesses are turned off (report_a...
Dmitry Vyukov [Fri, 1 Feb 2013 14:41:58 +0000 (14:41 +0000)]
tsan: even if races between atomic and plain memory accesses are turned off (report_atomic_races=0),
still report races between atomic accesses and free().

llvm-svn: 174175

11 years agolibclang: itroduce cxstring::createEmpty()
Dmitri Gribenko [Fri, 1 Feb 2013 14:21:22 +0000 (14:21 +0000)]
libclang: itroduce cxstring::createEmpty()

llvm-svn: 174174

11 years agolibclang: introduce cxstring::createNull()
Dmitri Gribenko [Fri, 1 Feb 2013 14:13:32 +0000 (14:13 +0000)]
libclang: introduce cxstring::createNull()

llvm-svn: 174173

11 years agoRe-design the convenience interfaces on MatchFinder.
Manuel Klimek [Fri, 1 Feb 2013 13:41:35 +0000 (13:41 +0000)]
Re-design the convenience interfaces on MatchFinder.

First, this implements a match() method on MatchFinder; this allows us
to get rid of the findAll implementation, as findAll is really a special
case of recursive matchers on match.

Instead of findAll, provide a convenience function match() that lets
users iterate easily over the results instead of needing to implement
callbacks.

llvm-svn: 174172

11 years agoUse const visitors in ASTDumper.
Alexander Kornienko [Fri, 1 Feb 2013 12:35:51 +0000 (12:35 +0000)]
Use const visitors in ASTDumper.
http://llvm-reviews.chandlerc.com/D355
Patch by Philip Craig!

llvm-svn: 174171

11 years agoAdd explicit triples to AArch64 tests
Tim Northover [Fri, 1 Feb 2013 11:40:47 +0000 (11:40 +0000)]
Add explicit triples to AArch64 tests

Only Linux is supported at the moment, and other platforms quickly fault. As a
result these tests would fail on non-Linux hosts. It may be worth making the
tests more generic again as more platforms are supported.

llvm-svn: 174170

11 years agoHopefully fix windows build due to non-standard pair implementation.
Daniel Jasper [Fri, 1 Feb 2013 11:28:16 +0000 (11:28 +0000)]
Hopefully fix windows build due to non-standard pair implementation.

llvm-svn: 174169

11 years agotsan: say that the memory access is atomic in reports
Dmitry Vyukov [Fri, 1 Feb 2013 11:10:53 +0000 (11:10 +0000)]
tsan: say that the memory access is atomic in reports

llvm-svn: 174168

11 years agotsan: remember 2 stack frames for atomics (caller and atomic itself)
Dmitry Vyukov [Fri, 1 Feb 2013 11:01:17 +0000 (11:01 +0000)]
tsan: remember 2 stack frames for atomics (caller and atomic itself)

llvm-svn: 174167

11 years agoRevamp of the basic layouting algorithm in clang-format.
Daniel Jasper [Fri, 1 Feb 2013 11:00:45 +0000 (11:00 +0000)]
Revamp of the basic layouting algorithm in clang-format.

In order to end up with good solutions, clang-format needs to try
"all" combinations of line breaks, evaluate them and select the
best one. Before, we have done this using a DFS with memoization
and cut-off conditions. However, this approach is very limited
as shown by the huge static initializer in the attachment of
llvm.org/PR14959.

Instead, this new implementation uses a variant of Dijkstra's
algorithm to do a prioritized BFS over the solution space.

Some numbers:
lib/Format/TokenAnnotator.cpp: 1.5s -> 0.15s
Attachment of PR14959: 10min+ (didn't finish) -> 10s

No functional changes intended.

llvm-svn: 174166

11 years agotsan: add flag to not report races between atomic and plain memory accesses
Dmitry Vyukov [Fri, 1 Feb 2013 10:06:56 +0000 (10:06 +0000)]
tsan: add flag to not report races between atomic and plain memory accesses

llvm-svn: 174165

11 years agotsan: flip is_write bit in shadow to is_read
Dmitry Vyukov [Fri, 1 Feb 2013 10:02:55 +0000 (10:02 +0000)]
tsan: flip is_write bit in shadow to is_read
this makes calculation of interesting predicates faster

llvm-svn: 174164

11 years agotsan: detect races between plain and atomic memory accesses
Dmitry Vyukov [Fri, 1 Feb 2013 09:42:06 +0000 (09:42 +0000)]
tsan: detect races between plain and atomic memory accesses

llvm-svn: 174163

11 years ago[Docs] Update status :)
Michael J. Spencer [Fri, 1 Feb 2013 09:20:24 +0000 (09:20 +0000)]
[Docs] Update status :)

llvm-svn: 174162

11 years ago[ELF][x86-64] Fix ifunc and add test.
Michael J. Spencer [Fri, 1 Feb 2013 09:14:21 +0000 (09:14 +0000)]
[ELF][x86-64] Fix ifunc and add test.

In an previous commit I managed to completely disable the IRELATIVE relocation
writing code. I also used the wrong addend for the static relocation. Fix both
these issues and add a test. This test is quite brittle because there's no way
to do arithmetic on variables in FileCheck.

llvm-svn: 174161

11 years agoFix diagnostic for bad alignas use: it can't be applied to functions.
Richard Smith [Fri, 1 Feb 2013 08:25:07 +0000 (08:25 +0000)]
Fix diagnostic for bad alignas use: it can't be applied to functions.

llvm-svn: 174160

11 years agoAdd a new -Wundefined-inline warning for inline functions which are used but not
Nick Lewycky [Fri, 1 Feb 2013 08:13:20 +0000 (08:13 +0000)]
Add a new -Wundefined-inline warning for inline functions which are used but not
defined. Fixes PR14993!

llvm-svn: 174158

11 years agoImplement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Richard Smith [Fri, 1 Feb 2013 08:12:08 +0000 (08:12 +0000)]
Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Also support alignas(0), which C++11 and C11 require us to ignore.

llvm-svn: 174157

11 years agoRevert r174152. The shift amount may overflow and in that case this transformation...
Nadav Rotem [Fri, 1 Feb 2013 07:59:33 +0000 (07:59 +0000)]
Revert r174152. The shift amount may overflow and in that case this transformation is illegal.

llvm-svn: 174156

11 years ago[ELF][x86-64] Implement static relocation model for TLS.
Michael J. Spencer [Fri, 1 Feb 2013 07:14:14 +0000 (07:14 +0000)]
[ELF][x86-64] Implement static relocation model for TLS.

This implements the static relocation model for GOT accesses to TLS.

llvm-svn: 174155

11 years ago[ELF][x86-84] Add static TLS support.
Michael J. Spencer [Fri, 1 Feb 2013 07:13:49 +0000 (07:13 +0000)]
[ELF][x86-84] Add static TLS support.

llvm-svn: 174154

11 years agoModified the expression parser's class wrapper to
Sean Callanan [Fri, 1 Feb 2013 06:55:48 +0000 (06:55 +0000)]
Modified the expression parser's class wrapper to
support reporting "this" as a templated class.  The
expression parser wraps expressions in C++ methods
as methods with the signature

$__lldb_class::$__lldb_expr(...)

and previously responded to clang's queries about
$__lldb_class with the type of *this.  This didn't
work if *this was a ClassTemplateSpecializationDecl
because ClassTemplateSpecializationDecls can't be
the result of simple name queries.

Instead what we do now is respond that $__lldb_class
is a typedef and that the target of the typedef is
the (potentially templated) type of *this.  That is
much more robust.

Thanks to John McCall for key insights.

<rdar://problem/10987183>

llvm-svn: 174153

11 years agoOptimize shift lefts of a constant by a value plus constant into a single shift.
Nadav Rotem [Fri, 1 Feb 2013 06:45:40 +0000 (06:45 +0000)]
Optimize shift lefts of a constant by a value plus constant into a single shift.

llvm-svn: 174152

11 years agoAdd PPC A2Q core and BG/Q preprocessor definitions
Hal Finkel [Fri, 1 Feb 2013 05:53:33 +0000 (05:53 +0000)]
Add PPC A2Q core and BG/Q preprocessor definitions

The a2q core is the variant of the a2 core used on the BG/Q supercomputers.

llvm-svn: 174151

11 years ago[ELF][x86-64] Add the _GLOBAL_OFFSET_TABLE_ Atom in the correct location.
Michael J. Spencer [Fri, 1 Feb 2013 05:36:14 +0000 (05:36 +0000)]
[ELF][x86-64] Add the _GLOBAL_OFFSET_TABLE_ Atom in the correct location.

Now we link against glibc without --noinhibit-exec.

llvm-svn: 174150

11 years ago[ELF] Add more absolute atoms. Simplify how they are resolved.
Michael J. Spencer [Fri, 1 Feb 2013 05:36:00 +0000 (05:36 +0000)]
[ELF] Add more absolute atoms. Simplify how they are resolved.

llvm-svn: 174149

11 years agoadd hexagon scatter bits and split hexgontargethandler to hexagonrelocationhander
Shankar Easwaran [Fri, 1 Feb 2013 05:26:02 +0000 (05:26 +0000)]
add hexagon scatter bits and split hexgontargethandler to hexagonrelocationhander

llvm-svn: 174148

11 years agoDestroy arrays and ARC fields when throwing out of ctors.
John McCall [Fri, 1 Feb 2013 05:11:40 +0000 (05:11 +0000)]
Destroy arrays and ARC fields when throwing out of ctors.

Previously we were only handling non-array fields of class type.

Testcases derived from a patch by WenHan Gu.

llvm-svn: 174146

11 years agoDon't do delayed exception-specification checking on an invalid
Douglas Gregor [Fri, 1 Feb 2013 04:49:10 +0000 (04:49 +0000)]
Don't do delayed exception-specification checking on an invalid
class. Fixes <rdar://problem/13017229>.

llvm-svn: 174145

11 years ago[docs] Fixup fallout from other grammar fixup.
Sean Silva [Fri, 1 Feb 2013 03:50:20 +0000 (03:50 +0000)]
[docs] Fixup fallout from other grammar fixup.

My "excuse" for not refactoring the grammar here is to not diverge too
far from the grammar in the comments of TGParser.cpp, since I'm not
taking on the quest of majorly refactoring TGParser.cpp at the moment.

One benefit of doing this is that Ideas for refactoring and clarifying
the grammar in this document should translate almost immediately to
beneficial refactorings that can be made to TGParser.cpp.

llvm-svn: 174144

11 years ago[docs] Add missing colon to TableGen grammar.
Sean Silva [Fri, 1 Feb 2013 03:32:38 +0000 (03:32 +0000)]
[docs] Add missing colon to TableGen grammar.

Spotted by Eli Bendersky.

llvm-svn: 174143

11 years agoMachineModel: Inconsequential TableGen SubtargetEmitter fix.
Andrew Trick [Fri, 1 Feb 2013 03:19:54 +0000 (03:19 +0000)]
MachineModel: Inconsequential TableGen SubtargetEmitter fix.

Drive by fix. I noticed some missing logic that might bite future
users. This shouldn't affect the final output on currently modeled
targets.

llvm-svn: 174142

11 years agoMake sure a value is returned for Thread::ReturnFromFrame().
Greg Clayton [Fri, 1 Feb 2013 02:52:31 +0000 (02:52 +0000)]
Make sure a value is returned for Thread::ReturnFromFrame().

llvm-svn: 174141

11 years agoEnable -fno-altivec, -mno-altivec for PowerPC.
Bill Schmidt [Fri, 1 Feb 2013 02:14:03 +0000 (02:14 +0000)]
Enable -fno-altivec, -mno-altivec for PowerPC.

Introduces these negation forms explicitly and uses them to control a new
"altivec" target feature for PowerPC.  This allows avoiding generating
Altivec instructions on processors that support Altivec.

The new test case verifies that the Altivec "lvx" instruction is not
used when -fno-altivec is present on the command line.

llvm-svn: 174140

11 years ago[Sema][Attr]Fix alignment attribute printing.
Michael Han [Fri, 1 Feb 2013 01:19:17 +0000 (01:19 +0000)]
[Sema][Attr]Fix alignment attribute printing.

Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should
only model those appear in source code. Introduce attribute Accessor, and teach TableGen
to generate syntax kind accessors for Align attribute, and use those accessors to decide
if an alignment attribute is a declspec attribute.

llvm-svn: 174133

11 years agoRemove some dead code, improve some asserts, and other assorted changes. No functiona...
Bill Wendling [Fri, 1 Feb 2013 01:04:27 +0000 (01:04 +0000)]
Remove some dead code, improve some asserts, and other assorted changes. No functionality change.

llvm-svn: 174132

11 years agoAdd a comment explaining an unavailable optimization.
Dan Gohman [Fri, 1 Feb 2013 00:49:06 +0000 (00:49 +0000)]
Add a comment explaining an unavailable optimization.

llvm-svn: 174131

11 years agoRemove one of the odious 'Raw' methods.
Bill Wendling [Fri, 1 Feb 2013 00:48:14 +0000 (00:48 +0000)]
Remove one of the odious 'Raw' methods.

llvm-svn: 174130

11 years agoAllow the target to give out the size of the red zone for given ABIs.
Greg Clayton [Fri, 1 Feb 2013 00:47:49 +0000 (00:47 +0000)]
Allow the target to give out the size of the red zone for given ABIs.

A bit of cleanup in the heap module.

llvm-svn: 174129

11 years agoGet rid for switch statement warning for unhandled cases.
Greg Clayton [Fri, 1 Feb 2013 00:46:49 +0000 (00:46 +0000)]
Get rid for switch statement warning for unhandled cases.

llvm-svn: 174128

11 years agoFixed register dumping for contained-regs.
Greg Clayton [Fri, 1 Feb 2013 00:45:52 +0000 (00:45 +0000)]
Fixed register dumping for contained-regs.

llvm-svn: 174127

11 years agoConsistently format sample diagnostics on this page.
Richard Smith [Fri, 1 Feb 2013 00:45:12 +0000 (00:45 +0000)]
Consistently format sample diagnostics on this page.

llvm-svn: 174126

11 years agoclang/test/Index/headerfile-comment-to-html.m: Try to unbreak libxml2-less hosts...
NAKAMURA Takumi [Fri, 1 Feb 2013 00:17:45 +0000 (00:17 +0000)]
clang/test/Index/headerfile-comment-to-html.m: Try to unbreak libxml2-less hosts to eliminate "CommentXMLValid".

llvm-svn: 174124

11 years agoUse iterators instead of relying upon a bitmask of attributes to remove attributes...
Bill Wendling [Fri, 1 Feb 2013 00:13:50 +0000 (00:13 +0000)]
Use iterators instead of relying upon a bitmask of attributes to remove attributes from an AttrBuilder.

llvm-svn: 174123

11 years agoRewrite instsimplify's handling if icmp on pointer values to remove the
Dan Gohman [Fri, 1 Feb 2013 00:11:13 +0000 (00:11 +0000)]
Rewrite instsimplify's handling if icmp on pointer values to remove the
remaining use of AliasAnalysis concepts such as isIdentifiedObject to
prove pointer inequality.

@external_compare in test/Transforms/InstSimplify/compare.ll shows a simple
case where a noalias argument can be equal to a global variable address, and
while AliasAnalysis can get away with saying that these pointers don't alias,
instsimplify cannot say that they are not equal.

llvm-svn: 174122

11 years agoFix another typo in the classof definitions that doesn't (currently)
Chandler Carruth [Fri, 1 Feb 2013 00:04:33 +0000 (00:04 +0000)]
Fix another typo in the classof definitions that doesn't (currently)
have any effect. Spotted by Eli in review, thanks!!!

llvm-svn: 174121

11 years agoAdd iterators to the AttributeSet class so that we can access the Attributes in a...
Bill Wendling [Thu, 31 Jan 2013 23:53:05 +0000 (23:53 +0000)]
Add iterators to the AttributeSet class so that we can access the Attributes in a nice way.

llvm-svn: 174120

11 years agoAn alloca can be equal to an argument. It can't *alias* an alloca, but it could
Dan Gohman [Thu, 31 Jan 2013 23:49:33 +0000 (23:49 +0000)]
An alloca can be equal to an argument. It can't *alias* an alloca, but it could
be equal, since there's nothing preventing a caller from correctly predicting
the stack location of an alloca.

llvm-svn: 174119

11 years agoSwitch the code added in r173885 to use the new, shiny RTTI
Chandler Carruth [Thu, 31 Jan 2013 23:43:14 +0000 (23:43 +0000)]
Switch the code added in r173885 to use the new, shiny RTTI
infrastructure on MCStreamer to test for whether there is an
MCELFStreamer object available.

This is just a cleanup on the AsmPrinter side of things, moving ad-hoc
tests of random APIs to a direct type query. But the AsmParser
completely broken. There were no tests, it just blindly cast its
streamer to an MCELFStreamer and started manipulating it.

I don't have a test case -- this actually failed on LLVM's own
regression test suite. Unfortunately the failure only appears when the
stars, compilers, and runtime align to misbehave when we read a pointer
to a formatted_raw_ostream as-if it were an MCAssembler. =/

UBSan would catch this immediately.

Many thanks to Matt for doing about 80% of the debugging work here in
GDB, Jim for helping to explain how exactly to fix this, and others for
putting up with the hair pulling that ensued during debugging it.

llvm-svn: 174118

11 years agoFix a think-o in the condition here. =[ I would commit the test that
Chandler Carruth [Thu, 31 Jan 2013 23:43:12 +0000 (23:43 +0000)]
Fix a think-o in the condition here. =[ I would commit the test that
caught this, but I want that in a separate commit in case there is
a need to revert the actual functional bit as part of reverting other
patches. This way, the commits relating to just getting the RTTI bits in
place are separate from the functional changes that start using them.

llvm-svn: 174117

11 years agos/AttrBuilder::addAttributes/AttrBuilder::addAttribute/g because that's more descript...
Bill Wendling [Thu, 31 Jan 2013 23:38:01 +0000 (23:38 +0000)]
s/AttrBuilder::addAttributes/AttrBuilder::addAttribute/g because that's more descriptive of what it actually is.

llvm-svn: 174116

11 years agoFix a copy/paste-o that got missed because 'check' doesn't build lto.
Chandler Carruth [Thu, 31 Jan 2013 23:34:47 +0000 (23:34 +0000)]
Fix a copy/paste-o that got missed because 'check' doesn't build lto.

llvm-svn: 174115

11 years agoComment parsing: add more comments to CommentCommands.td
Dmitri Gribenko [Thu, 31 Jan 2013 23:31:14 +0000 (23:31 +0000)]
Comment parsing: add more comments to CommentCommands.td

I hope the ASCII art delimiters are OK, since they group *groups* of commands --
that is really helpful.

llvm-svn: 174114

11 years agoGive the MCStreamer class hierarchy LLVM RTTI facilities for use with
Chandler Carruth [Thu, 31 Jan 2013 23:29:57 +0000 (23:29 +0000)]
Give the MCStreamer class hierarchy LLVM RTTI facilities for use with
isa<> and dyn_cast<>. In several places, code is already hacking around
the absence of this, and there seem to be several interfaces that might
be lifted and/or devirtualized using this.

This change was based on a discussion with Jim Grosbach about how best
to handle testing for specific MCStreamer subclasses. He said that this
was the correct end state, and everything else was too hacky so
I decided to just make it so.

No functionality should be changed here, this is just threading the kind
through all the constructors and setting up the classof overloads.

llvm-svn: 174113

11 years agoEscape backslash in the comment.
Dmitri Gribenko [Thu, 31 Jan 2013 23:20:06 +0000 (23:20 +0000)]
Escape backslash in the comment.

llvm-svn: 174112

11 years agoUpdate the tests.
Bill Wendling [Thu, 31 Jan 2013 23:17:12 +0000 (23:17 +0000)]
Update the tests.

This update coincides with r174110. That change ordered the attributes
alphabetically.

llvm-svn: 174111

11 years agoRemove the AttrBuilder form of the Attribute::get creators.
Bill Wendling [Thu, 31 Jan 2013 23:16:25 +0000 (23:16 +0000)]
Remove the AttrBuilder form of the Attribute::get creators.

The AttrBuilder is for building a collection of attributes. The Attribute object
holds only one attribute. So it's not really useful for the Attribute object to
have a creator which takes an AttrBuilder.

This has two fallouts:

1. The AttrBuilder no longer holds its internal attributes in a bit-mask form.
2. The attributes are now ordered alphabetically (hence why the tests have changed).

llvm-svn: 174110

11 years ago[Comment parsing] Add support for recognizing
Fariborz Jahanian [Thu, 31 Jan 2013 23:12:39 +0000 (23:12 +0000)]
[Comment parsing] Add support for recognizing
\headerfile command and representing it in an xml
document. Patch reviewed by Dmitri Gribenko.
// rdar://12397511

llvm-svn: 174109

11 years agoRegenerate configure to hopefully fix buildbot breakage. Oh how I love autoconf.
Richard Smith [Thu, 31 Jan 2013 23:02:23 +0000 (23:02 +0000)]
Regenerate configure to hopefully fix buildbot breakage. Oh how I love autoconf.

llvm-svn: 174108

11 years ago[Core] Only complain about undefined symbols if they are marked as canBeNullNever.
Michael J. Spencer [Thu, 31 Jan 2013 22:56:13 +0000 (22:56 +0000)]
[Core] Only complain about undefined symbols if they are marked as canBeNullNever.

llvm-svn: 174107

11 years agoUpdate AMDGPURegisterInfo::eliminateFrameIndex() corresponding to r174083.
NAKAMURA Takumi [Thu, 31 Jan 2013 22:55:51 +0000 (22:55 +0000)]
Update AMDGPURegisterInfo::eliminateFrameIndex() corresponding to r174083.

llvm-svn: 174106

11 years ago[analyzer]RetainCount: Fix an autorelease related false positive.
Anna Zaks [Thu, 31 Jan 2013 22:36:17 +0000 (22:36 +0000)]
[analyzer]RetainCount: Fix an autorelease related false positive.

The Cnt variable is adjusted (incremented) for simplification of
checking logic. The increment should not be stored in the state.

llvm-svn: 174104

11 years agoAdd -Wno-nested-anon-types to -pedantic builds of LLVM. This Clang warning
Richard Smith [Thu, 31 Jan 2013 22:19:12 +0000 (22:19 +0000)]
Add -Wno-nested-anon-types to -pedantic builds of LLVM. This Clang warning
catches uses of an extremely minor and widely-available C++ extension (which
every C++ compiler I could find supports, but EDG and Clang reject in strict
mode).

The diagnosed code pattern looks like this:

struct X {
  union {
    struct {
      int a;
      int b;
    } S;
  };
};

llvm-svn: 174103

11 years ago[lit] Add a test for internal shell execution behaviors.
Daniel Dunbar [Thu, 31 Jan 2013 22:15:20 +0000 (22:15 +0000)]
[lit] Add a test for internal shell execution behaviors.

llvm-svn: 174102

11 years ago[lit] Change to raise InternalShellError for all command execution issues.
Daniel Dunbar [Thu, 31 Jan 2013 22:15:15 +0000 (22:15 +0000)]
[lit] Change to raise InternalShellError for all command execution issues.

llvm-svn: 174101

11 years agoDocument another instsimplify assumption.
Dan Gohman [Thu, 31 Jan 2013 22:13:00 +0000 (22:13 +0000)]
Document another instsimplify assumption.

llvm-svn: 174100

11 years agoR600: Fold clamp, neg, abs
Tom Stellard [Thu, 31 Jan 2013 22:11:54 +0000 (22:11 +0000)]
R600: Fold clamp, neg, abs

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 174099

11 years agoR600: Consider bitcast when folding const_address node.
Tom Stellard [Thu, 31 Jan 2013 22:11:53 +0000 (22:11 +0000)]
R600: Consider bitcast when folding const_address node.

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 174098

11 years agoR600: Make store_dummy intrinsic more general by passing export type
Tom Stellard [Thu, 31 Jan 2013 22:11:46 +0000 (22:11 +0000)]
R600: Make store_dummy intrinsic more general by passing export type

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 174097