David Goodwin [Thu, 30 Jul 2009 18:56:48 +0000 (18:56 +0000)]
Cleanup and include code selection for some frame index cases.
llvm-svn: 77622
Devang Patel [Thu, 30 Jul 2009 18:56:46 +0000 (18:56 +0000)]
Start using DebugInfoFinder.
llvm-svn: 77621
Devang Patel [Thu, 30 Jul 2009 18:46:29 +0000 (18:46 +0000)]
Do not use getNamedValue() to lookup NamedMDNode. NamedMDNode is not a GlobalValue.
Thanks Benjamin Kramer!
llvm-svn: 77619
Devang Patel [Thu, 30 Jul 2009 18:45:09 +0000 (18:45 +0000)]
Fix MetadataBase::classof().
Thanks Benjamin Kramer!
llvm-svn: 77618
Daniel Dunbar [Thu, 30 Jul 2009 18:30:19 +0000 (18:30 +0000)]
Twine: Use raw_ostream::write_hex, remove unused itohexstr method.
llvm-svn: 77617
Daniel Dunbar [Thu, 30 Jul 2009 18:29:44 +0000 (18:29 +0000)]
Remove unintended changes.
llvm-svn: 77616
Devang Patel [Thu, 30 Jul 2009 18:25:15 +0000 (18:25 +0000)]
s/DebugInfoEnumerator/DebugInfoFinder/g
llvm-svn: 77615
Daniel Dunbar [Thu, 30 Jul 2009 18:21:23 +0000 (18:21 +0000)]
Add raw_ostream::write_hex
llvm-svn: 77614
Daniel Dunbar [Thu, 30 Jul 2009 18:18:54 +0000 (18:18 +0000)]
Remove itohexstr, which only had one user.
llvm-svn: 77613
Mike Stump [Thu, 30 Jul 2009 18:01:44 +0000 (18:01 +0000)]
Update based upon comments. Explain why we have an assert.
llvm-svn: 77612
David Goodwin [Thu, 30 Jul 2009 18:01:09 +0000 (18:01 +0000)]
Add missing D* register clobbers for Thumb-2 call.
llvm-svn: 77611
Mike Stump [Thu, 30 Jul 2009 17:53:53 +0000 (17:53 +0000)]
We'll also need a vtable pointer if we have virtual bases.
llvm-svn: 77610
Douglas Gregor [Thu, 30 Jul 2009 17:50:56 +0000 (17:50 +0000)]
What luck! Clang obtains support for refering to members of the
current instantiation when that current instantiation is a class
template partial specialization.
llvm-svn: 77609
Fariborz Jahanian [Thu, 30 Jul 2009 17:49:11 +0000 (17:49 +0000)]
Patch for future ir-gen for destructor calls.
llvm-svn: 77608
Ted Kremenek [Thu, 30 Jul 2009 17:41:23 +0000 (17:41 +0000)]
Lexically order files.
llvm-svn: 77607
Douglas Gregor [Thu, 30 Jul 2009 17:40:51 +0000 (17:40 +0000)]
Support out-of-line definitions of the members of class template
partial specializations.
llvm-svn: 77606
Daniel Dunbar [Thu, 30 Jul 2009 17:37:43 +0000 (17:37 +0000)]
Twines: Don't allow implicit conversion from integers, this is too tricky.
llvm-svn: 77605
Devang Patel [Thu, 30 Jul 2009 17:30:23 +0000 (17:30 +0000)]
walk DbgRegionStartInst and DbgRegionEndInst
llvm-svn: 77604
Devang Patel [Thu, 30 Jul 2009 17:25:33 +0000 (17:25 +0000)]
Fix comment.
llvm-svn: 77603
Dan Gohman [Thu, 30 Jul 2009 17:04:07 +0000 (17:04 +0000)]
Minor whitespace tidiness.
llvm-svn: 77602
Dan Gohman [Thu, 30 Jul 2009 17:02:08 +0000 (17:02 +0000)]
Rename GRAD to GR32_AD, to follow the naming convention of other
classes. And define its SubRegClassList.
llvm-svn: 77601
Douglas Gregor [Thu, 30 Jul 2009 16:10:26 +0000 (16:10 +0000)]
Initialize an otherwise-wild pointer. Fixes a crashy analyzer
llvm-svn: 77599
Chris Lattner [Thu, 30 Jul 2009 16:08:58 +0000 (16:08 +0000)]
add a random codegen deficiency.
llvm-svn: 77598
Benjamin Kramer [Thu, 30 Jul 2009 15:35:55 +0000 (15:35 +0000)]
fix a unitialized pointer in NamedMDNode (and reenable unittest)
llvm-svn: 77597
Benjamin Kramer [Thu, 30 Jul 2009 10:38:43 +0000 (10:38 +0000)]
fix cmake build
llvm-svn: 77589
Zhongxing Xu [Thu, 30 Jul 2009 09:14:54 +0000 (09:14 +0000)]
simple fixes.
llvm-svn: 77587
Sanjiv Gupta [Thu, 30 Jul 2009 09:12:56 +0000 (09:12 +0000)]
Allow targets to define libcall names for mem(cpy,set,move) intrinsics, rather than hardcoding them in DAG lowering.
llvm-svn: 77586
Zhongxing Xu [Thu, 30 Jul 2009 09:11:52 +0000 (09:11 +0000)]
Make AnalysisManager into its own source file and a pure data management class.
Move all components creation code into AnalysisConsumer::DigestAnalyzerOptions().
llvm-svn: 77585
Evan Cheng [Thu, 30 Jul 2009 08:56:19 +0000 (08:56 +0000)]
Add a note.
llvm-svn: 77584
Evan Cheng [Thu, 30 Jul 2009 08:44:08 +0000 (08:44 +0000)]
I've changed the semantics of MERGE_VALUES a bit. It's now allowed to live until scheduling. It's deleted when the scheduler translate DAG nodes to machine instructions.
This is currently used by X86 to handle atomic_load_add when the output of the node is not used. I believe there is a better solution. But I find MERGE_VALUES useful for selecting multi-output node when the dead output can be selected as a IMPLICIT_DEF.
llvm-svn: 77583
Evan Cheng [Thu, 30 Jul 2009 08:33:02 +0000 (08:33 +0000)]
Optimize some common usage patterns of atomic built-ins __sync_add_and_fetch() and __sync_sub_and_fetch.
When the return value is not used (i.e. only care about the value in the memory), x86 does not have to use add to implement these. Instead, it can use add, sub, inc, dec instructions with the "lock" prefix.
This is currently implemented using a bit of instruction selection trick. The issue is the target independent pattern produces one output and a chain and we want to map it into one that just output a chain. The current trick is to select it into a merge_values with the first definition being an implicit_def. The proper solution is to add new ISD opcodes for the no-output variant. DAG combiner can then transform the node before it gets to target node selection.
Problem #2 is we are adding a whole bunch of x86 atomic instructions when in fact these instructions are identical to the non-lock versions. We need a way to add target specific information to target nodes and have this information carried over to machine instructions. Asm printer (or JIT) can use this information to add the "lock" prefix.
llvm-svn: 77582
Daniel Dunbar [Thu, 30 Jul 2009 04:20:37 +0000 (04:20 +0000)]
Switch obvious clients to Twine instead of utostr (when they were already using
a Twine, e.g., for names).
- I am a little ambivalent about this; we don't want the string conversion of
utostr, but using overload '+' mixed with string and integer arguments is
sketchy. On the other hand, this particular usage is something of an idiom.
llvm-svn: 77579
Sanjiv Gupta [Thu, 30 Jul 2009 04:15:15 +0000 (04:15 +0000)]
Keep track of references to mem(cpy,move,set) and then print only one extern
declaration for them.
llvm-svn: 77578
Daniel Dunbar [Thu, 30 Jul 2009 03:55:04 +0000 (03:55 +0000)]
Update CMakeLists.txt
llvm-svn: 77577
Daniel Dunbar [Thu, 30 Jul 2009 03:47:15 +0000 (03:47 +0000)]
Twine: Provide [u]int{32,64} conversions via implicit constructors instead of
explicitly.
llvm-svn: 77576
Argyrios Kyrtzidis [Thu, 30 Jul 2009 03:42:08 +0000 (03:42 +0000)]
Fix Selector <-> GlobalSelector conversion.
llvm-svn: 77575
Ryan Flynn [Thu, 30 Jul 2009 03:15:39 +0000 (03:15 +0000)]
PR3679 - handle #pragma weak
llvm-svn: 77573
Daniel Dunbar [Thu, 30 Jul 2009 02:43:05 +0000 (02:43 +0000)]
Add -fblocks.
llvm-svn: 77571
Andreas Bolka [Thu, 30 Jul 2009 02:26:01 +0000 (02:26 +0000)]
Equal SCEVs of a subscript give rise to dependence.
llvm-svn: 77570
Daniel Dunbar [Thu, 30 Jul 2009 02:08:27 +0000 (02:08 +0000)]
Disable the NamedMDNodeTest, it is failing everywhere.
llvm-svn: 77569
Nate Begeman [Thu, 30 Jul 2009 02:00:06 +0000 (02:00 +0000)]
Typo
llvm-svn: 77568
Daniel Dunbar [Thu, 30 Jul 2009 01:57:45 +0000 (01:57 +0000)]
MultiTestRunner: Stop printing XFAILs on every run, this doesn't really have any
value.
llvm-svn: 77566
Dan Gohman [Thu, 30 Jul 2009 01:56:29 +0000 (01:56 +0000)]
Add a new register class to describe operands that can't be SP,
due to x86 encoding restrictions. This is currently off by default
because it may cause code quality regressions. This is for PR4572.
llvm-svn: 77565
Dan Gohman [Thu, 30 Jul 2009 01:33:17 +0000 (01:33 +0000)]
Minor whitespace tidiness.
llvm-svn: 77564
Zhongxing Xu [Thu, 30 Jul 2009 01:17:21 +0000 (01:17 +0000)]
This patch collects all analysis context data into a new class
AnalysisContext.
llvm-svn: 77563
Eli Friedman [Thu, 30 Jul 2009 01:10:26 +0000 (01:10 +0000)]
Remove bogus "unsupported" case for vectors (which shouldn't
ever trigger). Add an "unsupported" case that triggers for C++ code.
It would be nice if someone would implement this properly... it
shouldn't be too hard, but I haven't looked closely at the relevant
code.
llvm-svn: 77562
Mike Stump [Thu, 30 Jul 2009 01:02:10 +0000 (01:02 +0000)]
Fix type to be consistent with the rest of the code.
llvm-svn: 77560
Devang Patel [Thu, 30 Jul 2009 01:02:04 +0000 (01:02 +0000)]
Check null NameMDNode elements.
llvm-svn: 77559
Dan Gohman [Thu, 30 Jul 2009 00:40:42 +0000 (00:40 +0000)]
Eliminate a bunch of redundant tables.
llvm-svn: 77558
Bob Wilson [Thu, 30 Jul 2009 00:31:25 +0000 (00:31 +0000)]
Lower a 128-bit BUILD_VECTOR with 2 elements to a pair of INSERT_VECTOR_ELTs.
llvm-svn: 77557
Mike Stump [Thu, 30 Jul 2009 00:22:38 +0000 (00:22 +0000)]
Add ability to layout the vtable pointer in trivial cases. I noticed
that we would silently do bad things with virtual bases in the layout
code, so, we just turn them off. When people do better things with
them, we can turn them back on.
llvm-svn: 77556
Eli Friedman [Thu, 30 Jul 2009 00:11:31 +0000 (00:11 +0000)]
Fix gcc warning.
llvm-svn: 77555
Fariborz Jahanian [Thu, 30 Jul 2009 00:10:25 +0000 (00:10 +0000)]
ir-gen for nested non-virtual base member access
in current class.
llvm-svn: 77554
Dan Gohman [Thu, 30 Jul 2009 00:10:18 +0000 (00:10 +0000)]
Use array_endof instead of doing it manually.
llvm-svn: 77553
Eli Friedman [Thu, 30 Jul 2009 00:04:39 +0000 (00:04 +0000)]
Add support for -Wno-long-long.
llvm-svn: 77552
Argyrios Kyrtzidis [Thu, 30 Jul 2009 00:03:55 +0000 (00:03 +0000)]
Add support for ObjC message expressions, in the Analyzer:
-Accept an ObjC method and find all message expressions that this method may respond to.
-Accept an ObjC message expression and find all methods that may respond to it.
llvm-svn: 77551
Devang Patel [Thu, 30 Jul 2009 00:03:41 +0000 (00:03 +0000)]
Add NamedMDNode test.
llvm-svn: 77550
Devang Patel [Thu, 30 Jul 2009 00:02:57 +0000 (00:02 +0000)]
print single NamedMDNode.
llvm-svn: 77549
Argyrios Kyrtzidis [Thu, 30 Jul 2009 00:02:19 +0000 (00:02 +0000)]
Update CMake.
llvm-svn: 77548
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:41:46 +0000 (23:41 +0000)]
Support ObjC methods as Entities.
llvm-svn: 77547
Douglas Gregor [Wed, 29 Jul 2009 23:41:44 +0000 (23:41 +0000)]
There's no point in going through the getAs<TagType> stuff to find the definition of a tag, since tags rarely have more than one or two declarations
llvm-svn: 77546
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:41:33 +0000 (23:41 +0000)]
Use a STL helper template 'pair_value_iterator', by both DeclReferenceMap and SelectorMap.
llvm-svn: 77545
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:41:26 +0000 (23:41 +0000)]
Add ObjCMethodDecl::isThisDeclarationADefinition().
llvm-svn: 77544
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:41:18 +0000 (23:41 +0000)]
Index the selectors and provide the translation units that contain them
through the IndexProvider.
llvm-svn: 77543
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:41:08 +0000 (23:41 +0000)]
Add TranslationUnit::getSelectorMap().
llvm-svn: 77542
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:40:58 +0000 (23:40 +0000)]
Introduce SelectorMap whose purpose is to map selectors to objc methods and message exprs,
inside a particular ASTContext.
llvm-svn: 77541
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:40:48 +0000 (23:40 +0000)]
Find references inside blocks.
llvm-svn: 77540
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:40:39 +0000 (23:40 +0000)]
Use helper class ASTVisitor to fully traverse an AST.
llvm-svn: 77539
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:40:32 +0000 (23:40 +0000)]
Introduce the GlobalSelector class in the Indexing library.
GlobalSelector is an ASTContext-independent way to refer to Objective C selectors.
llvm-svn: 77538
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:40:21 +0000 (23:40 +0000)]
Use an IdentifierTable for names used for Entities.
llvm-svn: 77537
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:40:14 +0000 (23:40 +0000)]
-Introduce the idx::Analyzer class used for getting indexing information, like finding
references of a declaration across translation units.
-Modify the index-test tool to use it.
llvm-svn: 77536
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:40:02 +0000 (23:40 +0000)]
Introduce TULocation and TULocationHandler classes.
TULocation is like ASTLocation but also contains the TranslationUnit* that
the ASTLocation originated from.
llvm-svn: 77535
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:39:52 +0000 (23:39 +0000)]
Modify the Indexer class so that it can return the TranslationUnit that internal
decls originated from.
llvm-svn: 77534
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:39:42 +0000 (23:39 +0000)]
Add Entity::getInternalDecl() to be used only on Entities that refer to internal
(in translation unit) declarations.
llvm-svn: 77533
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:39:35 +0000 (23:39 +0000)]
Constify ASTLocation::print.
llvm-svn: 77532
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:39:25 +0000 (23:39 +0000)]
Fix some comments.
llvm-svn: 77531
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:39:18 +0000 (23:39 +0000)]
Add getDeclReferenceMap() to the abstract interface of TranslationUnit class.
llvm-svn: 77530
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:39:09 +0000 (23:39 +0000)]
Remove the TranslationUnit usage from clang-wpa.cpp since it's not really
necessary.
llvm-svn: 77529
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:39:03 +0000 (23:39 +0000)]
Introduce a helper template for the Handler classes and use it instead
of the iterator of the Indexer class.
llvm-svn: 77528
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:38:51 +0000 (23:38 +0000)]
Add an assert.
llvm-svn: 77527
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:38:45 +0000 (23:38 +0000)]
Accept Handler objects in parameters as references.
Reinforces that they shouldn't be null and it's a bit more natural when
they are passed as stack objects.
llvm-svn: 77526
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:38:35 +0000 (23:38 +0000)]
Rename EntityHandler::HandleEntity to Handle.
llvm-svn: 77525
Argyrios Kyrtzidis [Wed, 29 Jul 2009 23:38:21 +0000 (23:38 +0000)]
-Make IndexProvider an abstract interface for getting indexing information.
-Introduce Indexer as an IndexProvider implementation.
llvm-svn: 77524
Douglas Gregor [Wed, 29 Jul 2009 23:36:44 +0000 (23:36 +0000)]
Make tag declarations redeclarable. This change has three purposes:
1) Allow the Index library (and any other interested client) to walk
the set of declarations for a given tag (enum, union, class,
whatever). At the moment, this information is not readily available.
2) Reduce our dependence on TagDecl::TypeForDecl being mapped down
to a TagType (for which getDecl() will return the tag definition, if
one exists). This property won't exist for class template partial
specializations.
3) Make the canonical declaration of a TagDecl actually canonical,
e.g., so that it does not change when the tag is defined.
llvm-svn: 77523
Evan Cheng [Wed, 29 Jul 2009 23:20:20 +0000 (23:20 +0000)]
tbb / tbh instructions only branch forward, not backwards.
llvm-svn: 77522
Evan Cheng [Wed, 29 Jul 2009 23:03:41 +0000 (23:03 +0000)]
Add VFP3 D registers to the DPR register class.
llvm-svn: 77521
Nicolas Geoffray [Wed, 29 Jul 2009 22:55:02 +0000 (22:55 +0000)]
In TrimAllocationToSize, if a block is below the minimum allocation size,
there is no new block added to the free list. Therefore on the next
startFunctionBody call, a new slab must be allocated.
llvm-svn: 77520
Douglas Gregor [Wed, 29 Jul 2009 22:41:10 +0000 (22:41 +0000)]
Eliminate a few unused-variable warnings
llvm-svn: 77519
Douglas Gregor [Wed, 29 Jul 2009 22:40:58 +0000 (22:40 +0000)]
Eliminate an unused-variable warning
llvm-svn: 77518
Devang Patel [Wed, 29 Jul 2009 22:34:41 +0000 (22:34 +0000)]
Read and write NamedMDNode.
llvm-svn: 77517
Owen Anderson [Wed, 29 Jul 2009 22:17:13 +0000 (22:17 +0000)]
Move types back to the 2.5 API.
llvm-svn: 77516
Owen Anderson [Wed, 29 Jul 2009 22:16:19 +0000 (22:16 +0000)]
Update for LLVM API change.
llvm-svn: 77514
Devang Patel [Wed, 29 Jul 2009 22:04:47 +0000 (22:04 +0000)]
Print named metadata.
llvm-svn: 77513
Daniel Dunbar [Wed, 29 Jul 2009 22:00:43 +0000 (22:00 +0000)]
Fix PR4645 which was fallout from the fix for PR4641.
- Call RAUW to delete all instructions (this is a patch from Nick Lewycky).
llvm-svn: 77512
Devang Patel [Wed, 29 Jul 2009 21:58:56 +0000 (21:58 +0000)]
There is no need to keep name ref in NamedMDNode.
llvm-svn: 77511
Ted Kremenek [Wed, 29 Jul 2009 21:53:49 +0000 (21:53 +0000)]
Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()
And remove Type::getAsReferenceType(), etc.
This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.
llvm-svn: 77510
Ted Kremenek [Wed, 29 Jul 2009 21:43:22 +0000 (21:43 +0000)]
Remove 'StoreManager::OldCastRegion()', TypedViewRegion (which only
OldCastRegion used), and the associated command line option
'-analyzer-store=old-basic-cast'.
llvm-svn: 77509
Chris Lattner [Wed, 29 Jul 2009 21:36:49 +0000 (21:36 +0000)]
inline the global 'getInstrOperandRegClass' function into its callers
now that TargetOperandInfo does the heavy lifting.
llvm-svn: 77508
Evan Cheng [Wed, 29 Jul 2009 21:26:42 +0000 (21:26 +0000)]
Make sure Thumb2 uses the right call instructions.
llvm-svn: 77507
Fariborz Jahanian [Wed, 29 Jul 2009 21:26:28 +0000 (21:26 +0000)]
Fixed test.
llvm-svn: 77506