Commit Graph

56842 Commits

Author SHA1 Message Date
Nuno Lopes 34cef4c1c8 fix PR3859: crash with 'cc -V'
llvm-svn: 67472
2009-03-22 17:47:44 +00:00
Duncan Sands b1656c1e1f Add some explanations of how apint loads and stores
work.

llvm-svn: 67471
2009-03-22 11:33:16 +00:00
Bill Wendling a443ab4bcd Really should pass -dylib to the linker...
llvm-svn: 67469
2009-03-22 08:56:15 +00:00
Bill Wendling f3ef2c758f A dylib should be built as a dylib and not a bundle.
llvm-svn: 67468
2009-03-22 08:28:45 +00:00
Ted Kremenek dc637a0be9 PTHManager::Create():
- Make the Diagnostic::Level for PTH errors to be specified by the caller

clang (driver):
- Set the PTHManager diagnostic level to "Diagnostic::Error" for -include-pth
  (a hard error) and Diagnostic::Warning for -token-cache (we can still
  proceed).

llvm-svn: 67462
2009-03-22 06:42:39 +00:00
Anders Carlsson 7cbd8fb6b0 Keep track of whether a class is abstract or not. This is currently only used for the __is_abstract type trait.
llvm-svn: 67461
2009-03-22 01:52:17 +00:00
Chris Lattner e09ad90882 don't set the name of a call instruction to "call" in release-asserts
build.  This shaves another 3% off.

llvm-svn: 67460
2009-03-22 00:32:22 +00:00
Chris Lattner 47640221da fix CreateTempAlloca to not set a name on the alloca for temporaries
in release-assert builds.  For automatic variables, explicitly set
a name with setName that does not make a temporary std::string.

This speeds up -emit-llvm-only -disable-free on PR3810 by 4.6%

llvm-svn: 67459
2009-03-22 00:24:14 +00:00
Chris Lattner adda37fb62 add method to access a template argument.
llvm-svn: 67458
2009-03-22 00:18:18 +00:00
Chris Lattner 4ff71de880 set function/global names with setName instead of passing the name into the
ctor function.  This avoids creating a temporary std::string for the name,
speeding up the testcase in PR3810 by 3.8%

llvm-svn: 67457
2009-03-22 00:12:30 +00:00
Chris Lattner 17556b2d95 fix some warnings in release-assert mode.
llvm-svn: 67456
2009-03-22 00:10:22 +00:00
Chris Lattner 37082e2a39 fix test
llvm-svn: 67455
2009-03-21 23:59:11 +00:00
Duncan Sands 1f15ca7c7a Factorize out a concept - no functionality change.
llvm-svn: 67454
2009-03-21 21:27:31 +00:00
Mike Stump efd7caa825 Fixup codegen for nested block literals so that we generate
copy_helpers and dispose_helpers as necessary for them.

llvm-svn: 67453
2009-03-21 21:00:35 +00:00
Douglas Gregor 221c9a5578 Fix a thinko in the pre-allocation strategy for structured initializer
lists. The code wasn't accounting for the distinction between the
top-level call to getStructuredSubobjectInit and later calls that
occur deeper in the hierarchy. This problem manifested itself as
over-allocation in cases where we have large arrays of small
structures (<rdar://problem/6707362>).

llvm-svn: 67452
2009-03-21 18:13:52 +00:00
Evan Cheng 15f1754eb4 Re-commit r67334 and r67349 with fix.
llvm-svn: 67451
2009-03-21 18:12:24 +00:00
Fariborz Jahanian 629aed9327 Issue error if variables are defined inside an objc class,
category or protocol.

llvm-svn: 67450
2009-03-21 18:06:45 +00:00
Daniel Dunbar 891d57155e Frontend: Handle empty input on stdin.
- PR3854.

I think it makes more sense to change MemoryBuffer::getSTDIN (return 0
should indicate error, not empty), but it is documented to return 0
for empty inputs, and some other code appears to rely on this.

llvm-svn: 67449
2009-03-21 17:56:30 +00:00
Daniel Dunbar 8e93780c86 Frontend: Handle empty input on stdin.
- PR3854.

I think it makes more sense to change MemoryBuffer::getSTDIN (return 0
should indicate error, not empty), but it is documented to return 0
for empty inputs, and some other code appears to rely on this.

llvm-svn: 67448
2009-03-21 17:55:43 +00:00
Chris Lattner 45470943a9 now that all the decl reference and creation stuff is going through two
very simple places, reimplement the deferred decl emission logic to not be O(N^2),
fixing PR3810.

llvm-svn: 67447
2009-03-21 09:44:56 +00:00
Chris Lattner a85d68e5d8 fix a crash that could occur when a variable declaration became a
function definition.

llvm-svn: 67446
2009-03-21 09:25:43 +00:00
Chris Lattner 149927c9f8 simplify and cleanup global variable creation stuff to all go through one
code path.

llvm-svn: 67445
2009-03-21 09:16:30 +00:00
Chris Lattner 832323ea41 simplify management of llvm::Function creation to all go through
GetAddrOfFunction.  This is simpler and more efficient.

llvm-svn: 67444
2009-03-21 08:53:37 +00:00
Chris Lattner 5eaee5692c code cleanups, rename EmitForwardFunctionDefinition ->
CreateFunctionPrototypeIR, though my next patch will eliminate
it entirely.

llvm-svn: 67443
2009-03-21 08:38:50 +00:00
Chris Lattner 6574906818 fix several problems with asm renaming, by pulling it into the mangling code:
1. it wasn't applying to definitions, only declarations, e.g. int x __asm("foo")
2. multiple definitions were conflicting, they weren't getting merged.
3. the code was duplicated in several places.

llvm-svn: 67442
2009-03-21 08:24:40 +00:00
Chris Lattner 64c55933ed add some fixmes
llvm-svn: 67441
2009-03-21 08:13:05 +00:00
Chris Lattner a9cb6261bf reduce redundant calls of getMangledName.
llvm-svn: 67440
2009-03-21 08:06:59 +00:00
Chris Lattner 3bfce1887f simplify some more code.
llvm-svn: 67439
2009-03-21 08:03:33 +00:00
Chris Lattner 0c5e3132aa simplify and comment some code better. Make BindRuntimeGlobals
more optimistic that it will work (optimizing for the common case).

llvm-svn: 67438
2009-03-21 07:48:31 +00:00
Chris Lattner 3637652ab3 random code cleanups.
llvm-svn: 67437
2009-03-21 07:12:05 +00:00
Chris Lattner 6098e62d56 remove obviously dead code: you can't bitcast a pointer to "Ty" (a function type).
llvm-svn: 67436
2009-03-21 06:58:21 +00:00
Chris Lattner cbeda87da1 add a fastpath to ConstantExpr::getBitCast to handle the case when an obviously
unneeded bitcast is requested.  This is common for frontends who just unconditionally
cast even if the target is often the right type already.  THis prevents going into
getFoldedCast which switches on the opcode and does a bunch of other stuff before
doing the same opzn.

llvm-svn: 67435
2009-03-21 06:55:54 +00:00
Chris Lattner 9e8120e067 avoid making constant folding logic eliminate obviously dead bitcasts, speeding up PR3810
by ~2%.

llvm-svn: 67434
2009-03-21 06:53:34 +00:00
Chris Lattner 316e1c19df continue dancing around the obvious algorithm issues in PR3810:
This speeds up getAsIdentifierInfo from being a call to a function
with a big switch to a single testl instruction.  This speeds up
the example in PR3810 by 6.2%

llvm-svn: 67433
2009-03-21 06:49:19 +00:00
Chris Lattner 7d5608dd72 add an assertion for unreachable code.
llvm-svn: 67432
2009-03-21 06:40:50 +00:00
Chris Lattner 725a26b818 Add a fast path to CodeGenModule::getMangledName for almost all C functions,
speeding up the testcase in PR3810 by 60%.

llvm-svn: 67431
2009-03-21 06:31:09 +00:00
Chris Lattner c2d987425d partially inline getAttrs() to speed up PR3810 (and lots of
other code presumably) by 4.3%

llvm-svn: 67430
2009-03-21 06:27:31 +00:00
Chris Lattner cfbe9e746f simplify CXXNameMangler::mangle, making it exit earlier for C functions.
This speeds up a testcase in 3810 by ~16%.

llvm-svn: 67429
2009-03-21 06:19:20 +00:00
Chris Lattner 9b62dff5f6 add some inline methods for infix operators on sparse vectors,
tidy some df iteration stuff, patch by John Mosby!

llvm-svn: 67428
2009-03-21 05:40:09 +00:00
Daniel Dunbar 1acb0eb24f Driver: Give Compilation::Execute total control over the Driver result
code; and don't return an error code when -### is present, even if
errors occur.

llvm-svn: 67425
2009-03-21 00:40:53 +00:00
Ted Kremenek f97c47ca15 Add back warning about a PTH file not containing any identifiers, but don't make
it a hard error.

llvm-svn: 67424
2009-03-21 00:25:09 +00:00
Ted Kremenek b12f24116d Allow PTH files with no identifiers.
llvm-svn: 67423
2009-03-21 00:15:11 +00:00
Bruno Cardoso Lopes 9b9586a5ae Removed AFGR32 register class
Handle odd registers allocation in FGR32.

llvm-svn: 67422
2009-03-21 00:05:07 +00:00
Douglas Gregor 6d00c993f5 When building the structured initializer list, pre-allocate storage in
its vectors based on the subobject type we're initializing and the
(unstructured) initializer list. This eliminates some malloc thrashing
when parsing initializers (from 117 vector reallocations down to 0
when parsing Cocoa.h). We can't always pre-allocate the right amount
of storage, since designated initializers can cause us to initialize
in non-predictable patterns.

llvm-svn: 67421
2009-03-20 23:58:33 +00:00
Daniel Dunbar a792bad824 ccc/Driver/clang-fe: Accept -fbuiltin, and forward -f[no-]builtin to clang.
llvm-svn: 67420
2009-03-20 23:49:28 +00:00
Ted Kremenek 8b2c1cd5a2 Fix include-pth.c test case to (hopefully) more resilient to where and how tests
are executed.

llvm-svn: 67419
2009-03-20 23:45:36 +00:00
Daniel Dunbar ea9f032613 ccc/Driver: .s defaults to 'assembler-with-cpp' on Darwin.
- <rdar://problem/6669441> ccc doesn't handle assembler-with-cpp
   semantics correctly (but clang supports it)

 - This is sad, because it requires a fairly useless target
   hook. C'est la vie.

llvm-svn: 67418
2009-03-20 23:39:23 +00:00
Douglas Gregor 52a47e9c7b Destroy expressions properly when resizing an initializer list
llvm-svn: 67417
2009-03-20 23:38:03 +00:00
Bob Wilson dc40d5ae2c Fix a few more indentation problems and an 80-column violation.
llvm-svn: 67416
2009-03-20 23:16:43 +00:00
Douglas Gregor 85992cf607 InitListDesignations hasn't been used (ever). Eliminate it, and
simplify the parsing and action interface for designated
initializers.

llvm-svn: 67415
2009-03-20 23:11:49 +00:00