platform/upstream/llvm.git
11 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

11 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

11 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

11 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

11 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

11 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

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

llvm-svn: 165019

11 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

11 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

11 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

11 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

11 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

11 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

11 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

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

llvm-svn: 165006

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 years ago-Wformat: Don't check format strings in uninstantiated templates.
Jordan Rose [Tue, 2 Oct 2012 01:49:54 +0000 (01:49 +0000)]
-Wformat: Don't check format strings in uninstantiated templates.

Also applies to -Wnonnull, -Wtype-safety, and -Wnon-pod-varargs.
All of these can be better checked at instantiation time.

This change does not actually affect regular CallExpr function calls,
since the checks there only happen after overload resolution.
However, it will affect Objective-C method calls.

<rdar://problem/12373934>

llvm-svn: 164984

11 years agoFix 80-column violations. Cleanup whitespace in generated code.
Chad Rosier [Tue, 2 Oct 2012 00:25:57 +0000 (00:25 +0000)]
Fix 80-column violations. Cleanup whitespace in generated code.

llvm-svn: 164983

11 years agoclang/test/Index: Fix two tests. Both %S and %t are expanded to absolute paths.
NAKAMURA Takumi [Tue, 2 Oct 2012 00:11:53 +0000 (00:11 +0000)]
clang/test/Index: Fix two tests. Both %S and %t are expanded to absolute paths.

llvm-svn: 164982

11 years agoEmit symbol tables.
Hemant Kulkarni [Mon, 1 Oct 2012 23:53:20 +0000 (23:53 +0000)]
Emit symbol tables.
Reorganize to derive all sections from SectionChunk.
Construct section table header from SectionChunk.

llvm-svn: 164981

11 years ago[ms-inline asm] Use the convertToMapAndConstraints() function in the front-end.
Chad Rosier [Mon, 1 Oct 2012 23:45:59 +0000 (23:45 +0000)]
[ms-inline asm] Use the convertToMapAndConstraints() function in the front-end.
Rework the logic to account for the fact that we no longer create a MCInst.

llvm-svn: 164980

11 years ago[ms-inline asm] Add the convertToMapAndConstraints() function that is used to
Chad Rosier [Mon, 1 Oct 2012 23:45:51 +0000 (23:45 +0000)]
[ms-inline asm] Add the convertToMapAndConstraints() function that is used to
map constraints and MCInst operands to inline asm operands.  This replaces the
getMCInstOperandNum() function.

The logic to determine the constraints are not in place, so we still default to
a register constraint (i.e., "r"). Also, we no longer build the MCInst but
rather return just the opcode to get the MCInstrDesc.

llvm-svn: 164979

11 years ago[clang-tests] Changed relative paths to absolute paths in run command for annotate...
Michael Gottesman [Mon, 1 Oct 2012 23:39:44 +0000 (23:39 +0000)]
[clang-tests] Changed relative paths to absolute paths in run command for annotate-macro-args.m, get-cursor-macro-args.m, import_self.c.

This fixes make check-all failures when make -C is used to run the tests.

llvm-svn: 164978

11 years agoModern translator test. Breakup test into two and
Fariborz Jahanian [Mon, 1 Oct 2012 23:25:52 +0000 (23:25 +0000)]
Modern translator test. Breakup test into two and
skip the x86_64 version for mingw32 and win32.

llvm-svn: 164977

11 years agoThis change:
Sid Manning [Mon, 1 Oct 2012 23:23:05 +0000 (23:23 +0000)]
This change:
  * Updates ReaderELF.cpp contentType method to match ELF.h's logic and now handle
    typeData
  * Add -arch to ldd-core testdriver
  * Add testcase to check typeData
  * Update others to stay in sync with this change.

llvm-svn: 164976

11 years agotest/CodeGen/X86/red-zone2.ll: Add -mtriple=x86_64-linux, and FileCheck-ize.
NAKAMURA Takumi [Mon, 1 Oct 2012 22:48:07 +0000 (22:48 +0000)]
test/CodeGen/X86/red-zone2.ll: Add -mtriple=x86_64-linux, and FileCheck-ize.

llvm-svn: 164975

11 years agoMachO: direct-to-object attribute for data-in-code markers.
Jim Grosbach [Mon, 1 Oct 2012 22:20:54 +0000 (22:20 +0000)]
MachO: direct-to-object attribute for data-in-code markers.

The target backend can support data-in-code load commands even when
the assembler doesn't, or vice-versa. Allow targets to opt-in for
direct-to-object.

PR13973.

llvm-svn: 164974

11 years ago<rdar://problem/12349509> Renaming the structure that we use for NSDictionary children
Enrico Granata [Mon, 1 Oct 2012 21:49:10 +0000 (21:49 +0000)]
<rdar://problem/12349509> Renaming the structure that we use for NSDictionary children

llvm-svn: 164973

11 years agochecking test case for r164811. was an omission to not check this in. this was alrea...
Reed Kotler [Mon, 1 Oct 2012 21:35:06 +0000 (21:35 +0000)]
checking test case for  r164811. was an omission to not check this in. this was already approved

llvm-svn: 164972

11 years agoRename a test I just added.
Fariborz Jahanian [Mon, 1 Oct 2012 21:21:50 +0000 (21:21 +0000)]
Rename a test I just added.

llvm-svn: 164971

11 years agoobjective-C modern translator. Test for producing both
Fariborz Jahanian [Mon, 1 Oct 2012 20:55:56 +0000 (20:55 +0000)]
objective-C modern translator. Test for producing both
32bit and 64bit version of modern translator.
// rdar://12189793

llvm-svn: 164970

11 years ago[ms-inline asm] Expose the getReg() function in the base class.
Chad Rosier [Mon, 1 Oct 2012 20:53:03 +0000 (20:53 +0000)]
[ms-inline asm] Expose the getReg() function in the base class.

llvm-svn: 164969

11 years agoFix treatment of case which came up on std-proposals@: 'void' is permitted in core...
Richard Smith [Mon, 1 Oct 2012 20:36:17 +0000 (20:36 +0000)]
Fix treatment of case which came up on std-proposals@: 'void' is permitted in core constant expressions, despite not being a literal type.

llvm-svn: 164968

11 years agoPR13978: A 'decltype' DeclSpec has an expression representation, not a type
Richard Smith [Mon, 1 Oct 2012 20:35:07 +0000 (20:35 +0000)]
PR13978: A 'decltype' DeclSpec has an expression representation, not a type
representation. Fix crash if it appears in the return type of a member function
definition.

llvm-svn: 164967

11 years agoMove isObjCSelf into Expr.
Anna Zaks [Mon, 1 Oct 2012 20:34:04 +0000 (20:34 +0000)]
Move isObjCSelf into Expr.

llvm-svn: 164966

11 years ago[analyzer] Address Jordan's review for r164868.
Anna Zaks [Mon, 1 Oct 2012 20:33:58 +0000 (20:33 +0000)]
[analyzer] Address Jordan's review for r164868.

llvm-svn: 164965

11 years ago[Docs] Update File Headers section to cover doxygen style file level docs.
Michael J. Spencer [Mon, 1 Oct 2012 19:59:21 +0000 (19:59 +0000)]
[Docs] Update File Headers section to cover doxygen style file level docs.

llvm-svn: 164964

11 years agoAdd xml test for availability to comment-xml-schema.c
Fariborz Jahanian [Mon, 1 Oct 2012 19:10:40 +0000 (19:10 +0000)]
Add xml test for availability to comment-xml-schema.c

llvm-svn: 164961

11 years ago[analyzer] Allow ObjC ivar lvalues where the base is nil.
Jordan Rose [Mon, 1 Oct 2012 19:07:22 +0000 (19:07 +0000)]
[analyzer] Allow ObjC ivar lvalues where the base is nil.

By analogy with C structs, this seems to be legal, if probably discouraged.
It's only if the ivar is read from or written to that there's a problem.
Running a program that gets the "address" of an instance variable does in
fact return the offset when the base "object" is nil.

This isn't a full revert because r164442 includes some diagnostic tweaks
as well; those have been kept.

This partially reverts r164442 / 08965091770c9b276c238bac2f716eaa4da2dca4.

llvm-svn: 164960

11 years ago[analyzer] Add a test for PR13927 "offsetof replacement flagged as null deref"
Jordan Rose [Mon, 1 Oct 2012 19:07:19 +0000 (19:07 +0000)]
[analyzer] Add a test for PR13927 "offsetof replacement flagged as null deref"

This seems to be legal according to C11 6.5.3.2.

No functionality change.

llvm-svn: 164959

11 years agoRevert "[analyzer] Check that a member expr is valid even when the result is an lvalue."
Jordan Rose [Mon, 1 Oct 2012 19:07:15 +0000 (19:07 +0000)]
Revert "[analyzer] Check that a member expr is valid even when the result is an lvalue."

The original intent of this commit was to catch potential null dereferences
early, but it breaks the common "home-grown offsetof" idiom (PR13927):

 (((struct Foo *)0)->member - ((struct foo *)0))

As it turns out, this appears to be legal in C, per a footnote in
C11 6.5.3.2: "Thus, &*E is equivalent to E (even if E is a null pointer)".
In C++ this issue is still open:
  http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#232

We'll just have to make sure we have good path notes in the future.

This reverts r164441 / 9be016dcd1ca3986873a7b66bd4bc027309ceb59.

llvm-svn: 164958

11 years agoavailability in structured documents. Takes
Fariborz Jahanian [Mon, 1 Oct 2012 18:42:25 +0000 (18:42 +0000)]
availability in structured documents. Takes
care of comments by Dimitri and Doug.

llvm-svn: 164957

11 years agoRe-enable support for --program-prefix.
Jordan Rose [Mon, 1 Oct 2012 18:40:32 +0000 (18:40 +0000)]
Re-enable support for --program-prefix.

The Apple buildbots have been modified not to pass --target,
so they shouldn't choke on a default program prefix anymore.

Patch by Rick Foos!

llvm-svn: 164956

11 years agoHave AnalyzerOptions::getBooleanOption() stick the matching config
Ted Kremenek [Mon, 1 Oct 2012 18:28:19 +0000 (18:28 +0000)]
Have AnalyzerOptions::getBooleanOption() stick the matching config
string in the config table so that it can be dumped as part of the
config dumper.  Add a test to show that these options are sticking
and can be cross-checked using FileCheck.

llvm-svn: 164954

11 years agoAdd checker debug.ConfigDumper to dump the contents of the configuration table.
Ted Kremenek [Mon, 1 Oct 2012 18:28:14 +0000 (18:28 +0000)]
Add checker debug.ConfigDumper to dump the contents of the configuration table.
The format of this output is a WIP; largely I'm bringing it up now
for regression testing.  We can evolve the output format over time.

llvm-svn: 164953

11 years agoReapply "[analyzer] Handle inlined constructors for rvalue temporaries correctly."
Jordan Rose [Mon, 1 Oct 2012 17:51:35 +0000 (17:51 +0000)]
Reapply "[analyzer] Handle inlined constructors for rvalue temporaries correctly."

This is related to but not blocked by <rdar://problem/12137950>
("Return-by-value structs do not have associated regions")

This reverts r164875 / 3278d41e17749dbedb204a81ef373499f10251d7.

llvm-svn: 164952

11 years agoCleaning up the self initialization checker.
Richard Trieu [Mon, 1 Oct 2012 17:39:51 +0000 (17:39 +0000)]
Cleaning up the self initialization checker.
-Allow Sema to do more processing on the initial Expr before checking it.
-Remove the special conditions in HandleExpr()
-Move the code so that only one call site is needed.
-Removed the function from Sema and only call it locally.
-Warn on potentially evaluated reference variables, not just casts to r-values.
-Update tests.

llvm-svn: 164951

11 years ago<rdar://problem/12406088> Fixing a crasher with adding a regex command, due to access...
Enrico Granata [Mon, 1 Oct 2012 17:19:37 +0000 (17:19 +0000)]
<rdar://problem/12406088> Fixing a crasher with adding a regex command, due to accessing a shared pointer without first checking for NULL

llvm-svn: 164950

11 years agoForgot the SPIR test case.
Micah Villmow [Mon, 1 Oct 2012 17:07:51 +0000 (17:07 +0000)]
Forgot the SPIR test case.

llvm-svn: 164949

11 years agoAdd in support for SPIR to LLVM core. This adds a new target and two new calling...
Micah Villmow [Mon, 1 Oct 2012 17:01:31 +0000 (17:01 +0000)]
Add in support for SPIR to LLVM core. This adds a new target and two new calling conventions.

llvm-svn: 164948

11 years ago[analyzer] Make ProgramStateManager's SubEngine parameter optional.
Jordan Rose [Mon, 1 Oct 2012 16:53:40 +0000 (16:53 +0000)]
[analyzer] Make ProgramStateManager's SubEngine parameter optional.

It is possible and valid to have a state manager and associated objects
without having a SubEngine or checkers.

Patch by Olaf Krzikalla!

llvm-svn: 164947

11 years agoFix PR13899
Michael Liao [Mon, 1 Oct 2012 16:44:04 +0000 (16:44 +0000)]
Fix PR13899

- Update maximal stack alignment when stack arguments are prepared before a
  call.
- Test cases are enhanced to show it's not a Win32 specific issue but a generic
  one.

llvm-svn: 164946

11 years agoProvide a shortcut for MCObjectStreamer when emitting fills.
Benjamin Kramer [Mon, 1 Oct 2012 15:14:14 +0000 (15:14 +0000)]
Provide a shortcut for MCObjectStreamer when emitting fills.

Reduces runtime of i386-large-relocations.s by 10x in Release builds, even more
in Debug+Asserts builds.

llvm-svn: 164945

11 years agoFix ASTMatchersTests in configurations where
Daniel Jasper [Mon, 1 Oct 2012 15:05:34 +0000 (15:05 +0000)]
Fix ASTMatchersTests in configurations where
"#include <initializer_list>" is unavailable for whatever reason.

llvm-svn: 164944

11 years agoAdd matchers for selected C++11 features.
Daniel Jasper [Mon, 1 Oct 2012 13:40:41 +0000 (13:40 +0000)]
Add matchers for selected C++11 features.

Patch by Gábor Horváth.
Review: http://llvm-reviews.chandlerc.com/D46

llvm-svn: 164943

11 years agoFix more misspellings found by Duncan during review.
Chandler Carruth [Mon, 1 Oct 2012 12:30:45 +0000 (12:30 +0000)]
Fix more misspellings found by Duncan during review.

llvm-svn: 164940

11 years agoMake this plural. Spotted by Duncan in review (and a very old typo, this
Chandler Carruth [Mon, 1 Oct 2012 12:24:42 +0000 (12:24 +0000)]
Make this plural. Spotted by Duncan in review (and a very old typo, this
is the second time I've moved this comment around...)

llvm-svn: 164939

11 years agoPrune some unnecessary includes.
Chandler Carruth [Mon, 1 Oct 2012 12:21:54 +0000 (12:21 +0000)]
Prune some unnecessary includes.

llvm-svn: 164938

11 years agoFix several issues with alignment. We weren't always accounting for type
Chandler Carruth [Mon, 1 Oct 2012 12:16:54 +0000 (12:16 +0000)]
Fix several issues with alignment. We weren't always accounting for type
alignment requirements of the new alloca. As one consequence which was
reported as a bug by Duncan, we overaligned memcpy calls to ranges of
allocas after they were rewritten to types with lower alignment
requirements. Other consquences are possible, but I don't have any test
cases for them.

llvm-svn: 164937

11 years agoTargetData: s/uint32_t/unsigned/ per Kuba's request.
Benjamin Kramer [Mon, 1 Oct 2012 11:56:16 +0000 (11:56 +0000)]
TargetData: s/uint32_t/unsigned/ per Kuba's request.

llvm-svn: 164935

11 years agoSimplifyCFG: Don't crash when forming a switch bitmap with an undef default value.
Benjamin Kramer [Mon, 1 Oct 2012 11:31:48 +0000 (11:31 +0000)]
SimplifyCFG: Don't crash when forming a switch bitmap with an undef default value.

Fixes PR13985.

llvm-svn: 164934

11 years agoFactor the PHI and select speculation into a separate rewriter. This
Chandler Carruth [Mon, 1 Oct 2012 10:54:05 +0000 (10:54 +0000)]
Factor the PHI and select speculation into a separate rewriter. This
could probably be factored still further to hoist this logic into
a generic helper, but currently I don't have particularly clean ideas
about how to handle that.

This at least allows us to drop custom load rewriting from the
speculation logic, which in turn allows the existing load rewriting
logic to fire. In theory, this could enable vector promotion or other
tricks after speculation occurs, but I've not dug into such issues. This
is primarily just cleaning up the factoring of the code and the
resulting logic.

llvm-svn: 164933

11 years agoThe Redeclarable part of named decls is read before their name.
Axel Naumann [Mon, 1 Oct 2012 09:51:27 +0000 (09:51 +0000)]
The Redeclarable part of named decls is read before their name.
Lookup can nevertheless find them due to the serialized lookup table.
For instance when reading a template decl's templatedDecl, it will search for existing decls that it could be a redeclaration of, and find the half-read template decl.
Thus there is no point in asserting the names of decls.

llvm-svn: 164932

11 years agoAlso merge template redeclarations.
Axel Naumann [Mon, 1 Oct 2012 09:18:00 +0000 (09:18 +0000)]
Also merge template redeclarations.
Don't require specializations (of existing and read template) to be unique.

llvm-svn: 164931

11 years agoMark two Clang tests as passing on ARM
Nico Weber [Mon, 1 Oct 2012 08:44:54 +0000 (08:44 +0000)]
Mark two Clang tests as passing on ARM

Also move one of them from grep to FileCheck.
Patch from Joey Gouly <joey.gouly@arm.com>!

llvm-svn: 164929

11 years agofix test/CodeGen/tbaa-for-vptr.cpp: don't hardcode the index of metadata
Kostya Serebryany [Mon, 1 Oct 2012 08:39:00 +0000 (08:39 +0000)]
fix test/CodeGen/tbaa-for-vptr.cpp: don't hardcode the index of metadata

llvm-svn: 164928

11 years agoBring ASTReader and Writer into sync for the case where a canonical template speciali...
Axel Naumann [Mon, 1 Oct 2012 07:34:47 +0000 (07:34 +0000)]
Bring ASTReader and Writer into sync for the case where a canonical template specialization was written, which is non-canonical at the time of reading: force the reading of the ClassTemplateDecl if it was written.
The easiest way out is to store whether the decl was canonical at the time of writing.
Add test.

llvm-svn: 164927

11 years agoUse constants for all return values in switch. Allows clang to optimize it into a...
Craig Topper [Mon, 1 Oct 2012 07:33:27 +0000 (07:33 +0000)]
Use constants for all return values in switch. Allows clang to optimize it into a lookup table.

llvm-svn: 164926

11 years agoRefactor the PartitionUse structure to actually use the Use* instead of
Chandler Carruth [Mon, 1 Oct 2012 01:49:22 +0000 (01:49 +0000)]
Refactor the PartitionUse structure to actually use the Use* instead of
a pair of instructions, one for the used pointer and the second for the
user. This simplifies the representation and also makes it more dense.

This was noticed because of the miscompile in PR13926. In that case, we
were running up against a fundamental "bad idea" in the speculation of
PHI and select instructions: the speculation and rewriting are
interleaved, which requires phi speculation to also perform load
rewriting! This is bad, and causes us to miss opportunities to do (for
example) vector rewriting only exposed after PHI speculation, etc etc.
It also, in the old system, required us to insert *new* load uses into
the current partition's use list, which would then be ignored during
rewriting because we had already extracted an end iterator for the use
list. The appending behavior (and much of the other oddities) stem from
the strange de-duplication strategy in the PartitionUse builder.
Amusingly, all this went without notice for so long because it could
only be triggered by having *different* GEPs into the same partition of
the same alloca, where both different GEPs were operands of a single
PHI, and where the GEP which was not encountered first also had multiple
uses within that same PHI node... Hence the insane steps required to
reproduce.

So, step one in fixing this fundamental bad idea is to make the
PartitionUse actually contain a Use*, and to make the builder do proper
deduplication instead of funky de-duplication. This is enough to remove
the appending behavior, and fix the miscompile in PR13926, but there is
more work to be done here. Subsequent commits will lift the speculation
into its own visitor. It'll be a useful step toward potentially
extracting all of the speculation logic into a generic utility
transform.

The existing PHI test case for repeated operands has been made more
extreme to catch even these issues. This test case, run through the old
pass, will exactly reproduce the miscompile from PR13926. ;] We were so
close here!

llvm-svn: 164925

11 years agoUse dyn_cast instead of isa and cast.
Jakub Staszak [Sun, 30 Sep 2012 21:24:57 +0000 (21:24 +0000)]
Use dyn_cast instead of isa and cast.

No functionality change.

llvm-svn: 164924

11 years agoSimplifyCFG: Enumerating all predecessors of a BB can be expensive (switches), avoid...
Benjamin Kramer [Sun, 30 Sep 2012 21:03:56 +0000 (21:03 +0000)]
SimplifyCFG: Enumerating all predecessors of a BB can be expensive (switches), avoid it if possible.

No functionality change.

llvm-svn: 164923

11 years agoRST docs: convert HTML escapes to plain text in code examples.
Dmitri Gribenko [Sun, 30 Sep 2012 20:51:02 +0000 (20:51 +0000)]
RST docs: convert HTML escapes to plain text in code examples.

llvm-svn: 164922

11 years agoSphinx CSS: remove negative letter-spacing, it makes some fonts look really
Dmitri Gribenko [Sun, 30 Sep 2012 20:43:24 +0000 (20:43 +0000)]
Sphinx CSS: remove negative letter-spacing, it makes some fonts look really
bad.  Fonts already have appropriate tracking built-in.

llvm-svn: 164921

11 years agoFix &amp;&amp; to && in Coding Standards.
Jakub Staszak [Sun, 30 Sep 2012 20:42:13 +0000 (20:42 +0000)]
Fix &amp;&amp; to && in Coding Standards.

llvm-svn: 164920

11 years agoChange getX86SubSuperRegister to take an MVT::SimpleValueType rather than an EVT...
Craig Topper [Sun, 30 Sep 2012 19:49:56 +0000 (19:49 +0000)]
Change getX86SubSuperRegister to take an MVT::SimpleValueType rather than an EVT and add llvm_unreachable to the switches. Helps it compile to dramatically better code.

llvm-svn: 164919

11 years agoArgumentPromotion: Remove ancient workaround for a bug in the C backend.
Benjamin Kramer [Sun, 30 Sep 2012 17:31:56 +0000 (17:31 +0000)]
ArgumentPromotion: Remove ancient workaround for a bug in the C backend.

Fun fact: The CBE learned how to deal with this situation before it was removed.

llvm-svn: 164918

11 years agoCodeGen: Copy tail padding when we're not dealing with a trivial copy assign or move...
Benjamin Kramer [Sun, 30 Sep 2012 12:43:37 +0000 (12:43 +0000)]
CodeGen: Copy tail padding when we're not dealing with a trivial copy assign or move assign operator.

This fixes a regression from r162254, the optimizer has problems reasoning
about the smaller memcpy as it's often not safe to widen a store but making it
smaller is.

llvm-svn: 164917

11 years agoFilter out tools and unittests which we don't want to build when we're building clang...
Bill Wendling [Sun, 30 Sep 2012 11:23:30 +0000 (11:23 +0000)]
Filter out tools and unittests which we don't want to build when we're building clang only.

llvm-svn: 164916

11 years agoRemove this hack in favor of another, better way of performing the same thing.
Bill Wendling [Sun, 30 Sep 2012 11:22:45 +0000 (11:22 +0000)]
Remove this hack in favor of another, better way of performing the same thing.

llvm-svn: 164915

11 years agoIgnore apparent buffer overruns on external or weak globals. This is a major
Duncan Sands [Sun, 30 Sep 2012 07:30:10 +0000 (07:30 +0000)]
Ignore apparent buffer overruns on external or weak globals.  This is a major
source of false positives due to globals being declared in a header with some
kind of incomplete (small) type, but the actual definition being bigger.

llvm-svn: 164912