- Apr 30, 2011
-
-
Jakob Stoklund Olesen authored
range covers the entire block. The live range can't be terminated at a random instruction. llvm-svn: 130619
-
Eli Friedman authored
particular, make sure to handle WCHAR_MIN correctly. llvm-svn: 130618
-
Rafael Espindola authored
llvm-svn: 130617
-
Rafael Espindola authored
llvm-svn: 130616
-
Benjamin Kramer authored
This obviously helps a lot if the division would be turned into a libcall (think i64 udiv on i386), but div is also one of the few remaining instructions on modern CPUs that become more expensive when the bitwidth gets bigger. This also helps register pressure on i386 when dividing chars, divb needs two 8-bit parts of a 16 bit register as input where divl uses two registers. int foo(unsigned char a) { return a/10; } int bar(unsigned char a, unsigned char b) { return a/b; } compiles into (x86_64) _foo: imull $205, %edi, %eax shrl $11, %eax ret _bar: movzbl %dil, %eax divb %sil, %al movzbl %al, %eax ret llvm-svn: 130615
-
Benjamin Kramer authored
This folds away silly stuff like (a&255)/1000 -> 0. llvm-svn: 130614
-
Benjamin Kramer authored
llvm-svn: 130613
-
Douglas Gregor authored
partial ordering of function templates, use a simple superset relationship rather than the convertibility-implying isMoreQualifiedThan/compatibilyIncludes relationship. Fixes partial ordering between references and address-space-qualified references. llvm-svn: 130612
-
Rafael Espindola authored
is a bit ugly, but doing it on the base MCStreamer would be redundant with the object streamer which does it using SD. llvm-svn: 130611
-
Rafael Espindola authored
llvm-svn: 130609
-
Ken Dyck authored
SynthesizeByrefCopyDestroyHelper(). No change in functionality intended. llvm-svn: 130608
-
Chandler Carruth authored
llvm-svn: 130606
-
Chandler Carruth authored
types after looking through arrays. Arrays with an unknown bound seem to be specifically allowed in the library type traits in C++0x, and GCC's builtin __is_trivial returns 'true' for the type 'int[]'. Now Clang agrees with GCC about __is_trivial here. Also hardens these methods against dependent types by just returning false. llvm-svn: 130605
-
Chandler Carruth authored
trait arguments. Reflow the logic to use early exit instead of a complex condition expression. Switch to a switch for acting on different type traits and add a bunch of the recently implemented type traits here. This fixes one of the regressions with the new __is_standard_layout trait to again require a complete type. It also fixes some latent bugs in other traits that never did impose this despite the standard requiring it. However, all these bugs were hidden for non-borland systems where the default is to require a complete type. It's unclear to me what the best approach here is: providing an explicit lists for the ones requiring complete types only w/ Borland and using a default for the rest, or forcing this switch to enumerate the traits and make it clear which way each one goes. I'm still working on cleaning up the tests so that they actually catch this, a much more comprehensive update to the tests will come once I've worked through the bugs I'm finding via inspection. llvm-svn: 130604
-
Chandler Carruth authored
based on Doug's preferences when we discussed this in IRC. This brings the wording more in line with the standard. llvm-svn: 130603
-
Chandler Carruth authored
a Type method isStandardLayoutType, to keep our user API matching the type trait builtins as closely as possible. Also, implement it in terms of other Type APIs rather than in terms of other type traits. This models the implementation on that of isLiteralType and isTrivialType. There remain some common problems with these traits still, so this is a bit of a WIP. However, we can now fix all of these traits at the same time and in a consistent manner. llvm-svn: 130602
-
Chandler Carruth authored
type trait. The previous implementation suffered from several problems: 1) It implemented all of the logic in RecordType by walking over every base and field in a CXXRecordDecl and validating the constraints of the standard. This made for very straightforward code, but is extremely inefficient. It also is conceptually wrong, the logic tied to the C++ definition of standard-layout classes should be in CXXRecordDecl, not RecordType. 2) To address the performance problems with #1, a cache bit was added to CXXRecordDecl, and at the completion of every C++ class, the RecordType was queried to determine if it was a standard layout class, and that state was cached. Two things went very very wrong with this. First, the caching version of the query *was never called*. Even within the recursive steps of the walk over all fields and bases the caching variant was not called, making each query a full *recursive* walk. Second, despite the cache not being used, it was computed for every class declared, even when the trait was never used in the program. This probably significantly regressed compile time performance for edge-case files. 3) An ASTContext was required merely to query the type trait because querying it performed the actual computations. 4) The caching bit wasn't managed correctly (uninitialized). The new implementation follows the system for all the other traits on C++ classes by encoding all the state needed in the definition data and building up the trait incrementally as each base and member are added to the definition of the class. The idiosyncracies of the specification of standard-layout classes requires more state than I would like; currently 5 bits. I could eliminate one of the bits easily at the expense of both clarity and resilience of the code. I might be able to eliminate one of the other bits by computing its state in terms of other state bits in the definition. I've already done that in one place where there was a fairly simple way to achieve it. It's possible some of the bits could be moved out of the definition data and into some other structure which isn't serialized if the serialized bloat is a problem. That would preclude serialization of a partial class declaration, but that's likely already precluded. Comments on any of these issues welcome. llvm-svn: 130601
-
Benjamin Kramer authored
llvm-svn: 130600
-
Jakob Stoklund Olesen authored
llvm-svn: 130599
-
Ted Kremenek authored
llvm-svn: 130598
-
Jakob Stoklund Olesen authored
This could happen when trying to use a value that had been eliminated after dead code elimination and folding loads. llvm-svn: 130597
-
Jakob Stoklund Olesen authored
llvm-svn: 130596
-
Daniel Dunbar authored
that library has never been in the SDK. Fortunately, it shouldn't be necessary, since that library was also removed in 10.6. llvm-svn: 130595
-
Daniel Dunbar authored
to the linker. - Only do this explicitly with the argument for now, the linker will need to explicitly add support for this. llvm-svn: 130594
-
Daniel Dunbar authored
-mios-simulator-version-min. llvm-svn: 130593
-
Daniel Dunbar authored
update -mios-simulator-version-min to set it. llvm-svn: 130592
-
Daniel Dunbar authored
and associated deployment target environment variable. llvm-svn: 130591
-
NAKAMURA Takumi authored
llvm-svn: 130589
-
Rafael Espindola authored
llvm-svn: 130588
-
Rafael Espindola authored
the final assembly. It is the same technique used when targeting assemblers that don't support .loc. llvm-svn: 130587
-
Hongbin Zheng authored
llvm-svn: 130586
-
Rafael Espindola authored
llvm-svn: 130585
-
Nico Weber authored
llvm-svn: 130583
-
Jakob Stoklund Olesen authored
llvm-svn: 130582
-
Nico Weber authored
llvm-svn: 130581
-
Nico Weber authored
llvm-svn: 130577
-
Nico Weber authored
llvm-svn: 130576
-
Hongbin Zheng authored
llvm-svn: 130575
-
Hongbin Zheng authored
llvm-svn: 130574
-
Argyrios Kyrtzidis authored
Add a couple of assertions to make sure the bitfields can fit the value assigned to them. No functionality change. llvm-svn: 130573
-