Commit Graph

126682 Commits

Author SHA1 Message Date
NAKAMURA Takumi 5f9e2bfa94 clang/test/Rewriter/rewrite-modern-extern-c-func-decl.mm: Remove XFAIL and add -U__declspec. mingw32 tends to define built-in __declspec.
llvm-svn: 155910
2012-05-01 10:51:55 +00:00
Benjamin Kramer 512c1dce8f Value-initialize global to avoid global construction.
llvm-svn: 155909
2012-05-01 10:48:02 +00:00
Eli Bendersky 667b879e73 RuntimeDyld cleanup:
- Improved parameter names for clarity
- Added comments
- emitCommonSymbols should return void because its return value is not being
  used anywhere
- Attempt to reduce the usage of the RelocationValueRef type. Restricts it 
  for a single goal and may serve as a step for eventual removal.

llvm-svn: 155908
2012-05-01 10:41:12 +00:00
Benjamin Kramer 84b857e4e6 YAMLParser: get rid of global ctors & dtors.
llvm-svn: 155907
2012-05-01 10:19:59 +00:00
John McCall aeb11a8c0b Add a disclaimer to the new test, plus a user-declared ctor
to force the emission of vtordisps.

llvm-svn: 155906
2012-05-01 08:59:06 +00:00
John McCall e42a336604 Add support for laying out vtordisps according to our current
working knowledge of the Microsoft ABI.  Based on a patch by
Dmitry Sokolov.

llvm-svn: 155905
2012-05-01 08:55:32 +00:00
Abramo Bagnara ad36afd260 Fix compilation with mingw-w64.
llvm-svn: 155904
2012-05-01 08:38:19 +00:00
Bill Wendling b12f16e75f Change the PassManager from a reference to a pointer.
The TargetPassManager's default constructor wants to initialize the PassManager
to 'null'. But it's illegal to bind a null reference to a null l-value. Make the
ivar a pointer instead.
PR12468

llvm-svn: 155902
2012-05-01 08:27:43 +00:00
Craig Topper eb590aa956 Enable AVX on AMD Bulldozer processors.
llvm-svn: 155900
2012-05-01 07:18:03 +00:00
Craig Topper 05eb6e096a Allow BMI, AES, F16C, POPCNT, FMA3, and CLMUL to be detected on AMD processors.
llvm-svn: 155899
2012-05-01 07:10:32 +00:00
Eli Bendersky fc079081b7 RuntimeDyld code cleanup:
- There's no point having a different type for the local and global symbol
  tables.
- Renamed SymbolTable to GlobalSymbolTable to clarify the intention
- Improved const correctness where relevant

llvm-svn: 155898
2012-05-01 06:58:59 +00:00
Craig Topper bae0e9ea1d Make XOP and FMA4 require SSE4A to match GCC behavior. Use this to simplify Bulldozer feature list.
llvm-svn: 155897
2012-05-01 06:54:48 +00:00
Craig Topper d32ebcc36b Attempt to handle MRMInitReg in emitVEXOpcodePrefix. Hopefully fixes PR12711.
llvm-svn: 155896
2012-05-01 06:34:01 +00:00
Eli Bendersky 48221c5c54 Removed examples of stack frame inspection which no longer work for old JIT.
Added an example of MCJIT-based debugging.

llvm-svn: 155895
2012-05-01 06:15:40 +00:00
John McCall c84ed6a336 Abstract the emission of global destructors into ABI-specific code
and only consider using __cxa_atexit in the Itanium logic.  The
default logic is to use atexit().

Emit "guarded" initializers in Microsoft mode unconditionally.
This is definitely not correct, but it's closer to correct than
just not emitting the initializer.

Based on a patch by Timur Iskhodzhanov!

llvm-svn: 155894
2012-05-01 06:13:13 +00:00
David Blaikie 7afed5e5bf PR12710 - broken default argument handling for templates.
I broke this in r155838 by not actually instantiating non-dependent default arg
expressions. The motivation for that change was to avoid producing duplicate
conversion warnings for such default args (we produce them once when we parse
the template - there's no need to produce them at each instantiation) but
without actually instantiating the default arg, things break in weird ways.

Technically, I think we could still get the right diagnostic experience without
the bugs if we instantiated the non-dependent args (for non-dependent params
only) immediately, rather than lazily. But I'm not sure if such a refactoring/
change would be desirable so here's the conservative fix for now.

llvm-svn: 155893
2012-05-01 06:05:57 +00:00
Ted Kremenek 124066c5cb Place several uncovered warnings under warning flags, and tweak diagnostic output including the term "gc" (in lowercase).
llvm-svn: 155892
2012-05-01 05:56:02 +00:00
Craig Topper 43518cc55f Make XOP imply AVX as its needed to legalize the registers types.
llvm-svn: 155891
2012-05-01 05:41:41 +00:00
Craig Topper c0cef32b83 Remove HasSSE2 from AES and CLMUL predicates. It's now implied by the HasAES and HasCLMUL predicates.
llvm-svn: 155890
2012-05-01 05:35:02 +00:00
John McCall 7f0245d930 Remove some not-very-stable assumptions from this testcase.
llvm-svn: 155889
2012-05-01 05:29:32 +00:00
Craig Topper 29dd148a71 Make CLMUL and AES imply SSE2 since its needed to legalize the type.
llvm-svn: 155888
2012-05-01 05:28:32 +00:00
Ted Kremenek 555560c490 Teach RetainCountchecker about IORegistryEntrySearchCFProperty returning retained objects. I know there is an SDK enhancement request for this to have the cf_returns_retained annotation, so this is just a stop gap.
llvm-svn: 155887
2012-05-01 05:28:27 +00:00
John McCall b91cd6687c Refactor the C++ ABI code a little bit to take advantage of
what I'm going to treat as basically universal properties of
array-cookie code.  Implement MS array cookies on top of that.
Based on a patch by Timur Iskhodzhanov!

llvm-svn: 155886
2012-05-01 05:23:51 +00:00
Craig Topper 0eacda5f69 Enable AVX and FMA4 for AMD Bulldozer processors.
llvm-svn: 155885
2012-05-01 05:18:13 +00:00
Nick Lewycky 78ee67e814 An instruction in a loop is not guaranteed to be executed just because the loop
has no exit blocks. Fixes PR12706!

llvm-svn: 155884
2012-05-01 04:03:01 +00:00
David Blaikie dabed2229c Fix use of uninitialized variable caught by GCC's -Wmaybe-uninitialized.
Review by Doug Gregor.

llvm-svn: 155880
2012-05-01 02:45:39 +00:00
John McCall 23dfaa1cef When mangling a synthetic function declaration, we might not have
type-source information for its parameters.  Don't crash when
mangling them in the MS C++ ABI.  Patch by Timur Iskhodzhanov!

llvm-svn: 155879
2012-05-01 02:33:44 +00:00
Douglas Gregor d37a0c0944 Revert r155874.
llvm-svn: 155878
2012-05-01 02:04:03 +00:00
Douglas Gregor 8d302d824c Remove the unused DestroyAttrs, noticed by Michael Han.
llvm-svn: 155877
2012-05-01 01:56:29 +00:00
Douglas Gregor bfb4a2138c Turn the mixed-sign-comparison diagnostic into a runtime behavior
diagnostic, from Eitan Adler!

llvm-svn: 155876
2012-05-01 01:53:49 +00:00
Douglas Gregor b52637051f Print inline for inline namespaces, from Faisal Vali
llvm-svn: 155875
2012-05-01 01:43:38 +00:00
Douglas Gregor 77b2b350f7 Move a non portable test to FileCheck, from Jonathan Gray!
llvm-svn: 155874
2012-05-01 01:42:40 +00:00
Jim Ingham e2b6ad65a2 Use a cache of the results of "GetFileAddress" from a symbol in the Comparator we are using to sort the various lookup indices by symbol address. When we switched to weak pointers,
this lookup got slightly slower.  Not enough to matter for most uses, but in the sort algorithm it does matter.

llvm-svn: 155873
2012-05-01 01:34:15 +00:00
Douglas Gregor f4fc4dff7d Move warn_cxx0x_right_shift_in_template_arg to CXX11Compat group, from
Dmitri Gribenko!

llvm-svn: 155872
2012-05-01 01:32:13 +00:00
Kaelyn Uhrain d4ea98aa41 Let's use the correct bool this time.
llvm-svn: 155871
2012-05-01 01:17:53 +00:00
Kaelyn Uhrain 48506ece7d A couple of very small tweaks suggested by Doug in reply to r155580 and r155163.
llvm-svn: 155870
2012-05-01 01:16:25 +00:00
David Blaikie b15de1eaed Remove ref/value inconsistency in redecl_iterator.
Similar to r155808 - this mistake has been made in a few iterators.

Based on Chandler Carruth's feedback to r155808 I added an implicit conversion
to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the
dyn_cast (due to template argument deduction causing the conversion not to be
used) - there for future convenience, though. This idiom (op T* for iterators)
seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I
fix up the other iterators here.

llvm-svn: 155869
2012-05-01 00:48:43 +00:00
John McCall d7bca7629c My first effort to do this more subtly failed, so elaborately
test for an invalid declaration at every single place in the
constant evaluator that's about to request a struct layout.

llvm-svn: 155868
2012-05-01 00:38:49 +00:00
Lang Hames 3a90fabd85 Add support for llvm.arm.neon.vmull* intrinsics to InstCombine. Fixes
<rdar://problem/11291436>.

This is a second attempt at a fix for this, the first was r155468. Thanks
to Chandler, Bob and others for the feedback that helped me improve this.

llvm-svn: 155866
2012-05-01 00:20:38 +00:00
Ted Kremenek ad8cd30095 malloc size checker: Ignore const'ness of pointer types when determining of a sizeof() type is compatible with a pointed type.
Fixes <rdar://problem/11292586>.

llvm-svn: 155864
2012-05-01 00:10:19 +00:00
Tobias Grosser ca9a2913b7 Remove unused function
Suggested by: Sebastian Pop

llvm-svn: 155863
2012-04-30 23:49:05 +00:00
Michael J. Spencer 729e234828 Add some docs on the type of flags link.exe has that our driver will need to support.
llvm-svn: 155861
2012-04-30 23:45:49 +00:00
Douglas Gregor f7b8841b71 Add support for openSUSE 12.2, from Ismail Donmez!
llvm-svn: 155860
2012-04-30 23:42:57 +00:00
Jakub Staszak cec09b2594 Add some constantness. No functionality change.
llvm-svn: 155859
2012-04-30 23:41:30 +00:00
Douglas Gregor 3e653b3628 clang_getCursorLexicalParent should return a translation unit cursor for declarations at the global scope, from Evan P. Fixes PR9083.
llvm-svn: 155858
2012-04-30 23:41:16 +00:00
Richard Smith fa139cd3bd Remove -Wc++98-compat warning for an outrageously-rare circumstance of 'this'
being used in an exception specification in a way which isn't otherwise
ill-formed in C++98: this warning also incorrectly triggered on uses of 'this'
inside thread-safety attributes, and the mechanism required to tell these cases
apart is more complex than can be justified by the (minimal) value of this part
of -Wc++98-compat.

llvm-svn: 155857
2012-04-30 23:33:33 +00:00
Argyrios Kyrtzidis b4015e1877 When going through references to check if the function returns the address
of a local variable, make sure we don't infinitely recurse when the
reference binds to itself.

e.g:

int* func() {
    int& i = i;    // assign non-exist variable to a reference which has same name.
    return &i;    // return pointer
}

rdar://11345441

llvm-svn: 155856
2012-04-30 23:23:55 +00:00
Fariborz Jahanian faded5bb0f modern objective-c translator. named aggregate types
defined inside the objc class belong to class's
decl. scope. This is to conform to objective-c
rules. // rdar://11351299

llvm-svn: 155855
2012-04-30 23:20:30 +00:00
Manman Ren 4f4d5c8fc8 X86: optimization for -(x != 0)
This patch will optimize -(x != 0) on X86
FROM 
cmpl	$0x01,%edi
sbbl	%eax,%eax
notl	%eax
TO
negl %edi
sbbl %eax %eax

llvm-svn: 155853
2012-04-30 22:51:25 +00:00
Jim Grosbach e78031a9f3 ARM: Diagnostics for out of range fixups.
Replace some assert() calls w/ actual diagnostics. In a perfect world,
there'd be range checks on these values long before things ever reached
this code. For now, though, issuing a better-late-than-never diagnostic
is still a big improvement over assert().

rdar://11347287

llvm-svn: 155851
2012-04-30 22:30:43 +00:00