platform/upstream/llvm.git
12 years agoUpdate the block specification for some long-settled subleties.
John McCall [Wed, 3 Oct 2012 04:57:59 +0000 (04:57 +0000)]
Update the block specification for some long-settled subleties.

llvm-svn: 165090

12 years agoFix 80-column violation
Craig Topper [Wed, 3 Oct 2012 03:56:12 +0000 (03:56 +0000)]
Fix 80-column violation

llvm-svn: 165089

12 years agoInlineObjCInstanceMethod.m: Remove lines introduced in r165079. It broke some builds...
NAKAMURA Takumi [Wed, 3 Oct 2012 02:35:19 +0000 (02:35 +0000)]
InlineObjCInstanceMethod.m: Remove lines introduced in r165079. It broke some builds, on FreeBSD, Linux and Windows.

error: 'warning' diagnostics expected but not seen:
  Line 94: types are incompatible
1 error generated.

llvm-svn: 165088

12 years ago[PCH] Fix serialization of an ImportDecl.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:45 +0000 (01:58 +0000)]
[PCH] Fix serialization of an ImportDecl.

ImportDecl's module ID was not written out and the reader accepted as module ID
the serialized:
  Record.push_back(!IdentifierLocs.empty());

llvm-svn: 165087

12 years agoSet the file entry for a Module* that was created during deserialization
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:42 +0000 (01:58 +0000)]
Set the file entry for a Module* that was created during deserialization
of a module file.

llvm-svn: 165086

12 years agoAdd a FIXME.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:39 +0000 (01:58 +0000)]
Add a FIXME.

llvm-svn: 165085

12 years agoIntroduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:37 +0000 (01:58 +0000)]
Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
when an ImportDecl that was implicitly created due to an inclusion directive.

llvm-svn: 165084

12 years agoSome renames to use the 'visitor' nomenclature, no functionality change.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:28 +0000 (01:58 +0000)]
Some renames to use the 'visitor' nomenclature, no functionality change.

llvm-svn: 165083

12 years agoImprove C++11 attribute parsing.
Michael Han [Wed, 3 Oct 2012 01:56:22 +0000 (01:56 +0000)]
Improve C++11 attribute parsing.

- General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST.
- Add support to parse arguments of attributes that in 'gnu' namespace.
- Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic.

llvm-svn: 165082

12 years agotest/ExecutionEngine/MCJIT: MCJIT should work also on mingw.
NAKAMURA Takumi [Wed, 3 Oct 2012 01:42:37 +0000 (01:42 +0000)]
test/ExecutionEngine/MCJIT: MCJIT should work also on mingw.

FIXME: Also cygwin?
llvm-svn: 165081

12 years agoThe kernel loading code is now isolated in the DynamicLoaderDarwinKernel;
Jason Molenda [Wed, 3 Oct 2012 01:29:34 +0000 (01:29 +0000)]
The kernel loading code is now isolated in the DynamicLoaderDarwinKernel;
remove the duplicates of this code in ProcessGDBRemote and ProcessKDP.
These two Process plugins will hardcode their DynamicLoader name to be
the DynamicLoaderDarwinKernel so the correct DynamicLoader is picked,
and return the kernel load address as the ImageInfosAddress.
<rdar://problem/12417038>

llvm-svn: 165080

12 years ago[analyzer] Adjust the return type of an inlined devirtualized method call.
Jordan Rose [Wed, 3 Oct 2012 01:08:35 +0000 (01:08 +0000)]
[analyzer] Adjust the return type of an inlined devirtualized method call.

In C++, overriding virtual methods are allowed to specify a covariant
return type -- that is, if the return type of the base method is an
object pointer type (or reference type), the overriding method's return
type can be a pointer to a subclass of the original type. The analyzer
was failing to take this into account when devirtualizing a method call,
and anything that relied on the return value having the proper type later
would crash.

In Objective-C, overriding methods are allowed to specify ANY return type,
meaning we can NEVER be sure that devirtualizing will give us a "safe"
return value. Of course, a program that does this will most likely crash
at runtime, but the analyzer at least shouldn't crash.

The solution is to check and see if the function/method being inlined is
the function that static binding would have picked. If not, check that
the return value has the same type. If the types don't match, see if we
can fix it with a derived-to-base cast (the C++ case). If we can't,
return UnknownVal to avoid crashing later.

<rdar://problem/12409977>

llvm-svn: 165079

12 years ago[analyzer] Push evalDynamicCast and evalDerivedToBase up to Store.
Jordan Rose [Wed, 3 Oct 2012 01:08:32 +0000 (01:08 +0000)]
[analyzer] Push evalDynamicCast and evalDerivedToBase up to Store.

These functions are store-agnostic, and would benefit from information in
DynamicTypeInfo but gain nothing from the store type.

No intended functionality change.

llvm-svn: 165078

12 years agoTeach getCXXRecordDeclForPointerType about references.
Jordan Rose [Wed, 3 Oct 2012 01:08:28 +0000 (01:08 +0000)]
Teach getCXXRecordDeclForPointerType about references.

Then, rename it getPointeeCXXRecordDecl and give it a nice doc comment,
and actually use it.

No intended functionality change.

llvm-svn: 165077

12 years agoThird try at fixing this. ;] Go back to using std::remove_if, which has
Chandler Carruth [Wed, 3 Oct 2012 01:04:07 +0000 (01:04 +0000)]
Third try at fixing this. ;] Go back to using std::remove_if, which has
most of the behavior we want, but wrap the predicate in one which erases
elements from the set if they pass the predicate. Oh what I wouldn't
give for a lambda here.

Let me know if the predicate wrapping is too much magic. ;]

llvm-svn: 165076

12 years agoThe early if conversion pass is ready to be used as an opt-in.
Jakob Stoklund Olesen [Wed, 3 Oct 2012 00:51:32 +0000 (00:51 +0000)]
The early if conversion pass is ready to be used as an opt-in.

Enable the pass by default for targets that request it, and change the
-enable-early-ifcvt to the opposite -disable-early-ifcvt.

There are still some x86 regressions when enabling early if-conversion
because of the missing machine models. Disable the pass for x86 until
machine models are added.

llvm-svn: 165075

12 years agoChange how the SelfReferenceChecker handles MemberExpr. Instead of treating
Richard Trieu [Wed, 3 Oct 2012 00:41:36 +0000 (00:41 +0000)]
Change how the SelfReferenceChecker handles MemberExpr.  Instead of treating
each one separately, process a stack of MemberExpr's as a single unit so that
static calls and member access will not be warned on.

llvm-svn: 165074

12 years agoSwitch the SetVector::remove_if implementation to use partition which
Chandler Carruth [Wed, 3 Oct 2012 00:03:00 +0000 (00:03 +0000)]
Switch the SetVector::remove_if implementation to use partition which
preserves the values of the relocated entries, unlikely remove_if. This
allows walking them and erasing them.

Also flesh out the predicate we are using for this to support the
various constraints actually imposed on a UnaryPredicate -- without this
we can't compose it with std::not1.

Thanks to Sean Silva for the review here and noticing the issue with
std::remove_if.

llvm-svn: 165073

12 years agoFix a serious X86 instruction selection bug. In
Evan Cheng [Tue, 2 Oct 2012 23:49:13 +0000 (23:49 +0000)]
Fix a serious X86 instruction selection bug. In
X86DAGToDAGISel::PreprocessISelDAG(), isel is moving load inside
callseq_start / callseq_end so it can be folded into a call. This can
create a cycle in the DAG when the call is glued to a copytoreg. We
have been lucky this hasn't caused too many issues because the pre-ra
scheduler has special handling of call sequences. However, it has
caused a crash in a specific tailcall case.

rdar://12393897

llvm-svn: 165072

12 years agoRevert "Don't use a debug location for frame setup instructions in the"
Eric Christopher [Tue, 2 Oct 2012 23:43:11 +0000 (23:43 +0000)]
Revert "Don't use a debug location for frame setup instructions in the"

This reverts 165055 and 165052 temporarily while I look at debugger
failures.

llvm-svn: 165071

12 years agoRevert 165058, per Jim request. This requires further discussion.
Chad Rosier [Tue, 2 Oct 2012 23:38:55 +0000 (23:38 +0000)]
Revert 165058, per Jim request.  This requires further discussion.

llvm-svn: 165070

12 years agoRevert 165057, per Jim's request. This requires further discussion.
Chad Rosier [Tue, 2 Oct 2012 23:38:50 +0000 (23:38 +0000)]
Revert 165057, per Jim's request.  This requires further discussion.

llvm-svn: 165069

12 years agoAdded a test for C++11 statement attributes serialization.
Alexander Kornienko [Tue, 2 Oct 2012 23:11:53 +0000 (23:11 +0000)]
Added a test for C++11 statement attributes serialization.

Summary: Uses [[clang::fallthrough]] attribute in a template function, and -Wimplicit-fallthrough to check the attribute presence in an instantiation.

Reviewers: rsmith

Reviewed By: rsmith

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

llvm-svn: 165068

12 years agoThe mips 64bit instructions DSLL, DSRA, DSRL, DEXT and DINS get transformed by the...
Jack Carter [Tue, 2 Oct 2012 23:09:40 +0000 (23:09 +0000)]
The mips 64bit instructions DSLL, DSRA, DSRL, DEXT and DINS get transformed by the assembler or through codegen direct object output to other variants based on the value of the immediate values of the operands.

If the code is generated as assembler, this transformation does not occur assuming that it will occur later in the assembler.

This code was originally called from  MipsAsmPrinter.cpp and we needed to check for OutStreamer.hasRawTextSupport(). This was not a good place for it and has been moved to MCTargetDesc/MipsMCCodeEmitter.cpp where both direct object and the assembler use it it automagically.

The test cases have been checked in for a number of weeks now.

llvm-svn: 165067

12 years ago[Doc parse]: SUpport for message in deprecated/unavailable
Fariborz Jahanian [Tue, 2 Oct 2012 23:01:04 +0000 (23:01 +0000)]
[Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.

llvm-svn: 165066

12 years agoTeach the new SROA to handle cases where an alloca that has already been
Chandler Carruth [Tue, 2 Oct 2012 22:46:45 +0000 (22:46 +0000)]
Teach the new SROA to handle cases where an alloca that has already been
scheduled for processing on the worklist eventually gets deleted while
we are processing another alloca, fixing the original test case in
PR13990.

To facilitate this, add a remove_if helper to the SetVector abstraction.
It's not easy to use the standard abstractions for this because of the
specifics of SetVectors types and implementation.

Finally, a nice small test case is included. Thanks to Benjamin for the
fantastic reduced test case here! All I had to do was delete some empty
basic blocks!

llvm-svn: 165065

12 years agoClean up these doxygen comments to follow the proposed new style. This
Chandler Carruth [Tue, 2 Oct 2012 22:46:40 +0000 (22:46 +0000)]
Clean up these doxygen comments to follow the proposed new style. This
also makes it more consistent with Clang and several passes' doxygen
style.

llvm-svn: 165064

12 years agoMake sure to put our sret argument into %rax on x86-64. Fixes PR13563!
Nick Lewycky [Tue, 2 Oct 2012 22:45:06 +0000 (22:45 +0000)]
Make sure to put our sret argument into %rax on x86-64. Fixes PR13563!

llvm-svn: 165063

12 years agoRemove the old coalescer algorithm.
Jakob Stoklund Olesen [Tue, 2 Oct 2012 22:45:03 +0000 (22:45 +0000)]
Remove the old coalescer algorithm.

The new algorithm has been enabled by default for almost a week now and
seems to be stable.

llvm-svn: 165062

12 years agoChange DynamicLoaderDarwinKernel::OSKextLoadedKextSummary to use
Jason Molenda [Tue, 2 Oct 2012 22:23:42 +0000 (22:23 +0000)]
Change DynamicLoaderDarwinKernel::OSKextLoadedKextSummary to use
the Symbols::LocateExecutableObjectFile method to locate kexts and
kernels instead of copying them out of the memory of the remote
system.  This is the fix for <rdar://problem/12416384>.

Fix a variable shadowing problem in
Symbols::LocateMacOSXFilesUsingDebugSymbols which caused the symbol
rich executable binaries to not be found even if they were listed
in the dSYM Info.plist.

Change Symbols::DownloadObjectAndSymbolFile to ignore dsymForUUID's
negative cache - this is typically being called by the user and we
should try even if there's a incorrect entry in the negative cache.

llvm-svn: 165061

12 years agoHandle reserved registers more accurately in handleMove().
Jakob Stoklund Olesen [Tue, 2 Oct 2012 22:08:36 +0000 (22:08 +0000)]
Handle reserved registers more accurately in handleMove().

Reserved register live ranges look like a set of dead defs - any uses of
reserved registers are ignored.

Instead of skipping the updating of reserved register operands entirely,
just ignore the use operands and treat the def operands normally.

No test case, handleMove() is not commonly used yet.

llvm-svn: 165060

12 years agoSilence -Wunused-value warning.
Ted Kremenek [Tue, 2 Oct 2012 21:50:18 +0000 (21:50 +0000)]
Silence -Wunused-value warning.

llvm-svn: 165059

12 years ago[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.
Chad Rosier [Tue, 2 Oct 2012 21:49:14 +0000 (21:49 +0000)]
[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.
A Sema lookup is used to determine the size of the variable, which is in turn
used during wildcard matching.

llvm-svn: 165058

12 years ago[ms-inline asm] Add basic support for wildcard MCParsedAsmOperands. This type
Chad Rosier [Tue, 2 Oct 2012 21:49:07 +0000 (21:49 +0000)]
[ms-inline asm] Add basic support for wildcard MCParsedAsmOperands.  This type
of operand is specific to MS-style inline assembly and should not be generated
when parsing normal assembly.

The purpose of the wildcard operands are to allow the AsmParser to match
multiple instructions (i.e., MCInsts) to a given ms-style asm statement.  For
the time being the matcher just returns the first match.  This patch only
implements wildcard matches for memory operands.  Support for register
wildcards will be added in the near future.

llvm-svn: 165057

12 years agoMake sure the whole live range is covered when values are pruned twice.
Jakob Stoklund Olesen [Tue, 2 Oct 2012 21:46:39 +0000 (21:46 +0000)]
Make sure the whole live range is covered when values are pruned twice.

JoinVals::pruneValues() calls LIS->pruneValue() to avoid conflicts when
overlapping two different values. This produces a set of live range end
points that are used to reconstruct the live range (with SSA update)
after joining the two registers.

When a value is pruned twice, the set of end points was insufficient:

  v1 = DEF
  v1 = REPLACE1
  v1 = REPLACE2
  KILL v1

The end point at KILL would only reconstruct the live range from
REPLACE2 to KILL, leaving the range REPLACE1-REPLACE2 dead.

Add REPLACE2 as an end point in this case so the full live range is
reconstructed.

This fixes PR13999.

llvm-svn: 165056

12 years agoAllow alternate instructions to silence bot.
Eric Christopher [Tue, 2 Oct 2012 21:44:16 +0000 (21:44 +0000)]
Allow alternate instructions to silence bot.

llvm-svn: 165055

12 years ago80-col.
Eric Christopher [Tue, 2 Oct 2012 21:44:12 +0000 (21:44 +0000)]
80-col.

llvm-svn: 165054

12 years agoClean-up of memory buffer and object ownership model in MCJIT
Andrew Kaylor [Tue, 2 Oct 2012 21:18:39 +0000 (21:18 +0000)]
Clean-up of memory buffer and object ownership model in MCJIT

llvm-svn: 165053

12 years agoDon't use a debug location for frame setup instructions in the
Eric Christopher [Tue, 2 Oct 2012 21:17:00 +0000 (21:17 +0000)]
Don't use a debug location for frame setup instructions in the
prologue. Also skip frame setup instructions when looking for the
first location.

llvm-svn: 165052

12 years agoUse the existing DebugLoc.
Eric Christopher [Tue, 2 Oct 2012 21:16:55 +0000 (21:16 +0000)]
Use the existing DebugLoc.

llvm-svn: 165051

12 years agoMake the location a parameter since we may not want the next one
Eric Christopher [Tue, 2 Oct 2012 21:16:53 +0000 (21:16 +0000)]
Make the location a parameter since we may not want the next one
in the block.

llvm-svn: 165050

12 years agoRemove the SavePoint infrastructure from fast isel, replace
Eric Christopher [Tue, 2 Oct 2012 21:16:50 +0000 (21:16 +0000)]
Remove the SavePoint infrastructure from fast isel, replace
with just an insert point from the MachineBasicBlock and let
the location be updated as we access it.

llvm-svn: 165049

12 years agoChanged test output comparison to be consistent with the way llvm-objdump and llvm...
Hemant Kulkarni [Tue, 2 Oct 2012 21:12:21 +0000 (21:12 +0000)]
Changed test output comparison to be consistent with the way llvm-objdump and llvm-readobj work.

llvm-svn: 165048

12 years ago[PCH/Module] Change the map of file-level DeclIDs to use a FileID
Argyrios Kyrtzidis [Tue, 2 Oct 2012 21:09:17 +0000 (21:09 +0000)]
[PCH/Module] Change the map of file-level DeclIDs to use a FileID
as key instead of a SLocEntry pointer. This allows the array of
file sorted declarations in a PCH/module to be deterministic.

llvm-svn: 165047

12 years ago[libclang] When indexing an AST file, only deserialize the file level
Argyrios Kyrtzidis [Tue, 2 Oct 2012 21:09:13 +0000 (21:09 +0000)]
[libclang] When indexing an AST file, only deserialize the file level
declarations of the current primary module.

llvm-svn: 165046

12 years ago[ms-inline asm] Fixup test case to be valid ms-style asm. Fix whitespace.
Chad Rosier [Tue, 2 Oct 2012 20:55:30 +0000 (20:55 +0000)]
[ms-inline asm] Fixup test case to be valid ms-style asm.  Fix whitespace.

llvm-svn: 165045

12 years agoRefactor clients of AnalyzerOptions::getBooleanOption() to have
Ted Kremenek [Tue, 2 Oct 2012 20:42:16 +0000 (20:42 +0000)]
Refactor clients of AnalyzerOptions::getBooleanOption() to have
an intermediate helper method to query and populate the Optional value.

llvm-svn: 165043

12 years agoSet the 'build clang only' flag when we're building only clang.
Bill Wendling [Tue, 2 Oct 2012 20:32:23 +0000 (20:32 +0000)]
Set the 'build clang only' flag when we're building only clang.

llvm-svn: 165042

12 years agoTweak AnalyzerOptions::getOptionAsInteger() to populate the string
Ted Kremenek [Tue, 2 Oct 2012 20:31:56 +0000 (20:31 +0000)]
Tweak AnalyzerOptions::getOptionAsInteger() to populate the string
table, making it printable with the ConfigDump checker.  Along the
way, fix a really serious bug where the value was getting parsed
from the string in code that was in an assert() call.  This means
in a Release-Asserts build this code wouldn't work as expected.

llvm-svn: 165041

12 years agoChange AnalyzerOptions::mayInlineCXXMemberFunction to default populate
Ted Kremenek [Tue, 2 Oct 2012 20:31:52 +0000 (20:31 +0000)]
Change AnalyzerOptions::mayInlineCXXMemberFunction to default populate
the config string table.  Also setup a test for dumping the analyzer
configuration for C++.

llvm-svn: 165040

12 years ago[Doc parsing]: Add available and deprecated attribute info
Fariborz Jahanian [Tue, 2 Oct 2012 20:05:47 +0000 (20:05 +0000)]
[Doc parsing]: Add available and deprecated attribute info
to XML output. // rdar://12378879

llvm-svn: 165039

12 years agoImprove overflow detection in StringRef::getAsUnsignedInteger().
Nick Kledzik [Tue, 2 Oct 2012 20:01:48 +0000 (20:01 +0000)]
Improve overflow detection in StringRef::getAsUnsignedInteger().

llvm-svn: 165038

12 years agoAdd a new isl based code generation
Tobias Grosser [Tue, 2 Oct 2012 19:50:43 +0000 (19:50 +0000)]
Add a new isl based code generation

This pass implements a new code generator that uses the code generation
algorithm included in isl.

For the moment the new code generation is limited to sequential code.

llvm-svn: 165037

12 years agoAdd an ast pretty printer pass based on the isl code generator
Tobias Grosser [Tue, 2 Oct 2012 19:50:38 +0000 (19:50 +0000)]
Add an ast pretty printer pass based on the isl code generator

llvm-svn: 165036

12 years agoUpdate isl to get the new code generation
Tobias Grosser [Tue, 2 Oct 2012 19:50:30 +0000 (19:50 +0000)]
Update isl to get the new code generation

llvm-svn: 165035

12 years agoDetect the isl code generation feature correctly
Tobias Grosser [Tue, 2 Oct 2012 19:50:22 +0000 (19:50 +0000)]
Detect the isl code generation feature correctly

llvm-svn: 165034

12 years agoMake vector::iterator and string::iterator more resilient against overly generic...
Howard Hinnant [Tue, 2 Oct 2012 19:45:42 +0000 (19:45 +0000)]
Make vector::iterator and string::iterator more resilient against overly generic relational operators.

llvm-svn: 165033

12 years agoFix another crasher in SROA, reported by Joel.
Chandler Carruth [Tue, 2 Oct 2012 18:57:13 +0000 (18:57 +0000)]
Fix another crasher in SROA, reported by Joel.

We require that the indices into the use lists are stable in order to
build fast lookup tables to locate a particular partition use from an
operand of a PHI or select. This is (obviously in hind sight)
incompatible with erasing elements from the array. Really, we don't want
to erase anyways. It is expensive, and a rare operation. Instead, simply
weaken the contract of the PartitionUse structure to allow null Use
pointers to represent dead uses. Now we can clear out the pointer to
mark things as dead, and all it requires is adding some 'continue'
checks to the various loops.

I'm still reducing a test case for this, as the test case I have is
huge. I think this one I can get a nice test case for though, as it was
much more deterministic.

llvm-svn: 165032

12 years ago[ms-inline asm] Enhance the isSimpleMSAsm() function to handle operands with pointer...
Chad Rosier [Tue, 2 Oct 2012 18:51:05 +0000 (18:51 +0000)]
[ms-inline asm] Enhance the isSimpleMSAsm() function to handle operands with pointer size
directives (e.g., dword ptr [eax]).

llvm-svn: 165031

12 years agoSupport for generating ELF objects on Windows.
Andrew Kaylor [Tue, 2 Oct 2012 18:38:34 +0000 (18:38 +0000)]
Support for generating ELF objects on Windows.

This adds 'elf' as a recognized target triple environment value and overrides the default generated object format on Windows platforms if that value is present.  This patch also enables MCJIT tests on Windows using the new environment value.

llvm-svn: 165030

12 years agoFix test for r165028. It only generates that flag for source files now.
Bill Wendling [Tue, 2 Oct 2012 18:07:59 +0000 (18:07 +0000)]
Fix test for r165028. It only generates that flag for source files now.
<rdar://problem/12401423>

llvm-svn: 165029

12 years agoDuring LTO, we call 'dsymutil' when we compile source files. This necessitates
Bill Wendling [Tue, 2 Oct 2012 18:02:50 +0000 (18:02 +0000)]
During LTO, we call 'dsymutil' when we compile source files. This necessitates
clang specifying a temporary file that it later cleans up so that it can survive
the linking stage. However, when we compile object files during LTO we don't
call 'dsymutil'. That's done at a different stage (if at all). We rely upon the
linker to specify a unique name for the temporary file it generates.
<rdar://problem/12401423>

llvm-svn: 165028

12 years agoFix a silly coding error on my part. The whole point of the speculator
Chandler Carruth [Tue, 2 Oct 2012 17:49:47 +0000 (17:49 +0000)]
Fix a silly coding error on my part. The whole point of the speculator
being separate was that it can grow the use list. As a consequence, we
can't use the iterator-pair interface, we need an index based interface.
Expose such an interface from the AllocaPartitioning, and use it in the
speculator.

This should at least fix a use-after-free bug found by Duncan, and may
fix some of the other crashers.

I don't have a nice deterministic test case yet, but if I get a good
one, I'll add it.

llvm-svn: 165027

12 years agoConvert to FileCheck.
Rafael Espindola [Tue, 2 Oct 2012 17:41:03 +0000 (17:41 +0000)]
Convert to FileCheck.

llvm-svn: 165026

12 years agoNo need to call the InitializeAll* functions.
Chad Rosier [Tue, 2 Oct 2012 16:41:12 +0000 (16:41 +0000)]
No need to call the InitializeAll* functions.

llvm-svn: 165025

12 years agoFP_CONTRACT: Fix two tests for -Asserts.
NAKAMURA Takumi [Tue, 2 Oct 2012 16:36:54 +0000 (16:36 +0000)]
FP_CONTRACT: Fix two tests for -Asserts.

llvm-svn: 165024

12 years ago[libclang] When indexing an AST file, only deserialize the preprocessing record
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:51 +0000 (16:10 +0000)]
[libclang] When indexing an AST file, only deserialize the preprocessing record
entities of the current primary module.

llvm-svn: 165023

12 years agoAdd info in the preprocessing record whether an inclusion directive
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:46 +0000 (16:10 +0000)]
Add info in the preprocessing record whether an inclusion directive
resulted in an automatic module import.

llvm-svn: 165022

12 years ago[libclang] Even though we disable the preprocessing record during indexing,
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:41 +0000 (16:10 +0000)]
[libclang] Even though we disable the preprocessing record during indexing,
make sure that it gets enabled for when a module needs to be created.

llvm-svn: 165021

12 years ago[libclang] Implement the importedASTFile indexing callback to provide
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:38 +0000 (16:10 +0000)]
[libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.

llvm-svn: 165020

12 years agoFix broken tests.
Benjamin Kramer [Tue, 2 Oct 2012 15:49:34 +0000 (15:49 +0000)]
Fix broken tests.

llvm-svn: 165019

12 years agoDo not patch the instruction address when symbolizing the reports.
Alexander Potapenko [Tue, 2 Oct 2012 15:42:24 +0000 (15:42 +0000)]
Do not patch the instruction address when symbolizing the reports.
Instead, print the correct address at runtime.

llvm-svn: 165018

12 years agoFix PR13991: legalizing an overflowing multiplication operation is harder than
Duncan Sands [Tue, 2 Oct 2012 15:03:49 +0000 (15:03 +0000)]
Fix PR13991: legalizing an overflowing multiplication operation is harder than
the add/sub case since in the case of multiplication you also have to check that
the operation in the larger type did not overflow.

llvm-svn: 165017

12 years agoSplitting this test case into two because the behavior for the calling convention...
Aaron Ballman [Tue, 2 Oct 2012 14:56:00 +0000 (14:56 +0000)]
Splitting this test case into two because the behavior for the calling convention code is target-specific.

llvm-svn: 165016

12 years agoAllowing individual targets to determine whether a given calling convention is allowe...
Aaron Ballman [Tue, 2 Oct 2012 14:26:08 +0000 (14:26 +0000)]
Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.

Fixes PR13782

llvm-svn: 165015

12 years ago[Sanitizer] fix line width
Alexey Samsonov [Tue, 2 Oct 2012 14:09:20 +0000 (14:09 +0000)]
[Sanitizer] fix line width

llvm-svn: 165009

12 years ago[ASan] Change __asan_set_on_error_callback to weak overridable __asan_on_error, so...
Alexey Samsonov [Tue, 2 Oct 2012 14:06:39 +0000 (14:06 +0000)]
[ASan] Change __asan_set_on_error_callback to weak overridable __asan_on_error, so that ASan would call the latter even if it finds the error early (i.e. during module initialization)

llvm-svn: 165008

12 years agoSilencing an MSVC warning about */ being found outside of a comment.
Aaron Ballman [Tue, 2 Oct 2012 13:54:25 +0000 (13:54 +0000)]
Silencing an MSVC warning about */ being found outside of a comment.

llvm-svn: 165007

12 years ago[*San]: handle EINTR.
Evgeniy Stepanov [Tue, 2 Oct 2012 13:41:40 +0000 (13:41 +0000)]
[*San]: handle EINTR.

llvm-svn: 165006

12 years agoAdd redecls into their lexical DeclContext: this is what they assert on, and the...
Axel Naumann [Tue, 2 Oct 2012 13:06:13 +0000 (13:06 +0000)]
Add redecls into their lexical DeclContext: this is what they assert on, and the merging should have set it correctly.
This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different.

llvm-svn: 165005

12 years agotsan: fix mac build
Dmitry Vyukov [Tue, 2 Oct 2012 12:58:14 +0000 (12:58 +0000)]
tsan: fix mac build

llvm-svn: 165004

12 years ago[ASan] Add extern C for __asan_symbolize on Windows
Alexey Samsonov [Tue, 2 Oct 2012 12:35:42 +0000 (12:35 +0000)]
[ASan] Add extern C for __asan_symbolize on Windows

llvm-svn: 165003

12 years agoEnable programmatic provisioning of virtual module.map files (instead of writing...
Axel Naumann [Tue, 2 Oct 2012 12:26:36 +0000 (12:26 +0000)]
Enable programmatic provisioning of virtual module.map files (instead of writing out actual module.map files).
Opens up the wonders of clang::Modules to tools - though they remain as experimental as before.

llvm-svn: 165002

12 years agoOnly those InterestingDecls that got added to the AST should be passed to the ASTCons...
Axel Naumann [Tue, 2 Oct 2012 12:18:46 +0000 (12:18 +0000)]
Only those InterestingDecls that got added to the AST should be passed to the ASTConsumer.

llvm-svn: 165001

12 years ago[Sanitizer/ASan] Simplify the code that prints and symbolizes stack traces. Fall...
Alexey Samsonov [Tue, 2 Oct 2012 12:11:17 +0000 (12:11 +0000)]
[Sanitizer/ASan] Simplify the code that prints and symbolizes stack traces. Fall back to module+offset if user-provided symbolizer failed. Use weak function __asan_symbolize instead of __asan_set_symbolize_callback in ASan interface, so that we're able to symbolize reports for errors that happen before the main() is called, for example, during module initialization.

llvm-svn: 165000

12 years agotsan: wait for pending reports before exit
Dmitry Vyukov [Tue, 2 Oct 2012 12:07:16 +0000 (12:07 +0000)]
tsan: wait for pending reports before exit

llvm-svn: 164999

12 years agotsan: output tid's in reports
Dmitry Vyukov [Tue, 2 Oct 2012 11:52:05 +0000 (11:52 +0000)]
tsan: output tid's in reports

llvm-svn: 164998

12 years agotsan: run output tests in parallel
Dmitry Vyukov [Tue, 2 Oct 2012 11:51:40 +0000 (11:51 +0000)]
tsan: run output tests in parallel

llvm-svn: 164997

12 years agoAdd default JIT LIT variable.
James Molloy [Tue, 2 Oct 2012 10:57:08 +0000 (10:57 +0000)]
Add default JIT LIT variable.

Patch by David Tweed!

llvm-svn: 164996

12 years ago-arch is a darwin-specific driver feature, use a triple instead in rewriter test.
Benjamin Kramer [Tue, 2 Oct 2012 09:42:36 +0000 (09:42 +0000)]
-arch is a darwin-specific driver feature, use a triple instead in rewriter test.

llvm-svn: 164995

12 years agoForce triple in test to unbreak it on non-darwin platforms.
Benjamin Kramer [Tue, 2 Oct 2012 09:29:48 +0000 (09:29 +0000)]
Force triple in test to unbreak it on non-darwin platforms.

llvm-svn: 164994

12 years agoMerge pending instantiations instead of overwriting existing ones.
Axel Naumann [Tue, 2 Oct 2012 09:09:43 +0000 (09:09 +0000)]
Merge pending instantiations instead of overwriting existing ones.
Check whether a pending instantiation needs to be instantiated (or whether an instantiation already exists).
Verify the size of the PendingInstantiations record (was only checking size of existing PendingInstantiations).

Migrate Obj-C++ part of redecl-merge into separate test, now that this is growing.
templates.mm: test that CodeGen has seen exactly one definition of template instantiations.
redecl-merge.m: use "@" specifier for expected-diagnostics.

llvm-svn: 164993

12 years agoUse an environment variable instead of what's in the make cmd goals.
Bill Wendling [Tue, 2 Oct 2012 06:19:15 +0000 (06:19 +0000)]
Use an environment variable instead of what's in the make cmd goals.

llvm-svn: 164992

12 years ago<rdar://problem/11791234>
Greg Clayton [Tue, 2 Oct 2012 06:04:17 +0000 (06:04 +0000)]
<rdar://problem/11791234>

Shared libraries on MacOSX were not properly being removed from the shared
module list when re-running a debug session due to an error in:

Module::MatchesModuleSpec()

llvm-svn: 164991

12 years agoTweak diagnostic text to indicate that __weak on a local variable is only allowed
Ted Kremenek [Tue, 2 Oct 2012 05:36:02 +0000 (05:36 +0000)]
Tweak diagnostic text to indicate that __weak on a local variable is only allowed
for ARC.  Fixes <rdar://problem/12407705>

llvm-svn: 164990

12 years agoAdd FP_CONTRACT support for clang.
Lang Hames [Tue, 2 Oct 2012 04:45:10 +0000 (04:45 +0000)]
Add FP_CONTRACT support for clang.

Clang will now honor the FP_CONTRACT pragma and emit LLVM
fmuladd intrinsics for expressions of the form A * B + C (when they occur in a
single statement).

llvm-svn: 164989

12 years agoCheck if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function.
Ted Kremenek [Tue, 2 Oct 2012 04:36:54 +0000 (04:36 +0000)]
Check if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function.

Fixes <rdar://problem/12355298>

llvm-svn: 164988

12 years agoRe-enable this test to reflect re-enabling the new SROA pass.
Chandler Carruth [Tue, 2 Oct 2012 04:24:16 +0000 (04:24 +0000)]
Re-enable this test to reflect re-enabling the new SROA pass.

llvm-svn: 164987

12 years agoTurn the new SROA pass back on. Let's see if it sticks this time. =]
Chandler Carruth [Tue, 2 Oct 2012 04:24:01 +0000 (04:24 +0000)]
Turn the new SROA pass back on. Let's see if it sticks this time. =]

Again, let me know if anything breaks due to this!

llvm-svn: 164986

12 years agoHandle KASLR kernel loading for kernel corefiles.
Jason Molenda [Tue, 2 Oct 2012 03:49:41 +0000 (03:49 +0000)]
Handle KASLR kernel loading for kernel corefiles.
Reduce the amount of output that DynamicLoaderDarwinKernel
prints for each kext it loads.
<rdar://problem/7714201>

llvm-svn: 164985