Commit Graph

103977 Commits

Author SHA1 Message Date
Jay Foad 3b422a1249 Like the coding standards say, do not use "using namespace std".
llvm-svn: 129435
2011-04-13 12:46:01 +00:00
Bill Wendling 2c1c33552d Remove comment that snuck in there.
llvm-svn: 129434
2011-04-13 10:05:14 +00:00
Bill Wendling 88ae43772a It looks like the FreeBSD buildbot needs this for the builtins-x86.c test.
llvm-svn: 129433
2011-04-13 10:02:54 +00:00
Cameron Zwarich 70be27e913 Fix an obvious problem with an alignment computation. AsmPrinter actually does
the max itself, so it is not easy to write a test case for this, but I added a
test case that would fail if the code in AsmPrinter were removed.

llvm-svn: 129432
2011-04-13 09:02:43 +00:00
Chandler Carruth 0a7aa3b60b Teach -Wuninitialized about C++'s typeid expression, including both the
evaluated and unevaluated contexts. Add some testing of sizeof and
typeid.

Both of the typeid tests added here were triggering warnings previously.
Now the one false positive is suppressed without suppressing the warning
on actually buggy code.

llvm-svn: 129431
2011-04-13 08:18:42 +00:00
Argyrios Kyrtzidis 71c58f3d59 Collect the options applicable to the Rewriter methods into a RewriterOptions struct.
llvm-svn: 129430
2011-04-13 07:15:11 +00:00
Cameron Zwarich 8001850ee8 Fix a typo.
llvm-svn: 129429
2011-04-13 06:39:16 +00:00
Cameron Zwarich cdf59f7016 If a global variable has a specified alignment that is less than the preferred
alignment for its type, use the minimum of the specified alignment and the ABI
alignment. This fixes <rdar://problem/9275290>.

llvm-svn: 129428
2011-04-13 06:03:16 +00:00
Bill Wendling b9c9e34cb3 Just use a native "load" instead of translating the builtin later. Clang can
take it!

I wasn't able to get __builtin_ia32_loaddqu to transform into an unaligned
load...I'll have to look into it further.

llvm-svn: 129427
2011-04-13 05:58:17 +00:00
Francois Pichet efc283c076 Still not used to put the * next to the variable name.
llvm-svn: 129426
2011-04-13 02:44:57 +00:00
Francois Pichet 48c946e5ef In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning. Up to now this is the only case I found where MSVC doesn't require "typename" at class scope. Really strange!
This fixes 1 error when parsing the MSVC 2008 header files.
Example:

template<class T> class A {
public:
  typedef int TYPE;
};
template<class T> class B : public A<T> {
public:
  A<T>::TYPE a; // no typename required because A<T> is a base class.
};

llvm-svn: 129425
2011-04-13 02:38:49 +00:00
Anders Carlsson bbe277c4a9 Use EmitCallOrInvoke in EmitBadTypeidCall and EmitBadCastCall.
llvm-svn: 129424
2011-04-13 02:35:36 +00:00
Nick Lewycky a8150b1c90 Use %ull here.
llvm-svn: 129423
2011-04-13 01:05:45 +00:00
Caroline Tice 69955f6cdc Fix various minor bugs in the ARM instruction emulation code.
llvm-svn: 129422
2011-04-13 00:42:12 +00:00
Andrew Trick b53a00d2cb Recommit r129383. PreRA scheduler heuristic fixes: VRegCycle, TokenFactor latency.
Additional fixes:
Do something reasonable for subtargets with generic
itineraries by handle node latency the same as for an empty
itinerary. Now nodes default to unit latency unless an itinerary
explicitly specifies a zero cycle stage or it is a TokenFactor chain.

Original fixes:
UnitsSharePred was a source of randomness in the scheduler: node
priority depended on the queue data structure. I rewrote the recent
VRegCycle heuristics to completely replace the old heuristic without
any randomness. To make the ndoe latency adjustments work, I also
needed to do something a little more reasonable with TokenFactor. I
gave it zero latency to its consumers and always schedule it as low as
possible.

llvm-svn: 129421
2011-04-13 00:38:32 +00:00
Bill Wendling 3137d3cb49 Convert the unaligned load builtins to the first-class versions.
llvm-svn: 129420
2011-04-13 00:36:37 +00:00
Bill Wendling b902f1dd88 Reapply r129401 with patch for clang.
llvm-svn: 129419
2011-04-13 00:36:11 +00:00
Eric Christopher 28f4c729f7 Temporarily revert r129408 to see if it brings the bots back.
llvm-svn: 129417
2011-04-13 00:20:59 +00:00
Greg Clayton 38068ca35f Revert newer xcscheme project file to avoid conflict with older Xcode
versions.

llvm-svn: 129416
2011-04-13 00:20:52 +00:00
Greg Clayton f6b8b58184 Added two new classes for command options:
lldb_private::OptionGroup
    lldb_private::OptionGroupOptions

OptionGroup lets you define a class that encapsulates settings that you want
to reuse in multiple commands. It contains only the option definitions and the
ability to set the option values, but it doesn't directly interface with the
lldb_private::Options class that is the front end to all of the CommandObject
option parsing. For that the OptionGroupOptions class can be used. It aggregates
one or more OptionGroup objects and directs the option setting to the 
appropriate OptionGroup class. For an example of this, take a look at the 
CommandObjectFile and how it uses its "m_option_group" object shown below
to be able to set values in both the FileOptionGroup and PlatformOptionGroup
classes. The members used in CommandObjectFile are:

    OptionGroupOptions m_option_group;
    FileOptionGroup m_file_options;
    PlatformOptionGroup m_platform_options;

Then in the constructor for CommandObjectFile you can combine the option
settings. The code below shows a simplified version of the constructor:

CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
    CommandObject (...),
    m_option_group (interpreter),
    m_file_options (),
    m_platform_options(true)
{
    m_option_group.Append (&m_file_options);
    m_option_group.Append (&m_platform_options);
    m_option_group.Finalize();
}

We append the m_file_options and then the m_platform_options and then tell
the option group the finalize the results. This allows the m_option_group to
become the organizer of our prefs and after option parsing we end up with
valid preference settings in both the m_file_options and m_platform_options
objects. This also allows any other commands to use the FileOptionGroup and
PlatformOptionGroup classes to implement options for their commands.

Renamed:
    virtual void Options::ResetOptionValues();
to:
    virtual void Options::OptionParsingStarting();

And implemented a new callback named:

    virtual Error Options::OptionParsingFinished();
    
This allows Options subclasses to verify that the options all go together
after all of the options have been specified and gives the chance for the
command object to return an error. It also gives a chance to take all of the
option values and produce or initialize objects after all options have
completed parsing.

Modfied:

    virtual Error
    SetOptionValue (int option_idx, const char *option_arg) = 0;
    
to be:

    virtual Error
    SetOptionValue (uint32_t option_idx, const char *option_arg) = 0;

(option_idx is now unsigned).

llvm-svn: 129415
2011-04-13 00:18:08 +00:00
Daniel Dunbar dc8355e81a Driver/no-integrated-as: Fix forwarding of -g flag to assembler, when .s input
undergoes preprocessing.

llvm-svn: 129414
2011-04-12 23:59:20 +00:00
Rafael Espindola 539d96f01d Be consistent about being virtual and returning void in the cfi methods.
Implement the ones that were missing in the asm streamer.

llvm-svn: 129413
2011-04-12 23:59:07 +00:00
Fariborz Jahanian 82bc436c28 Redeclaration of 'self' should be flagged in
objective-c instead of crashing in IRgen.
// rdar://9154582.

llvm-svn: 129412
2011-04-12 23:39:33 +00:00
Johnny Chen 3c2f74c9f3 Add sanity check for Ld/St Dual forms of Thumb2 instructions.
rdar://problem/9273947

llvm-svn: 129411
2011-04-12 23:31:00 +00:00
Daniel Dunbar 9c8cd4c097 IRgen/Obj-C: Emit CFStrings and NSStrings with the alignment of the char type,
there is no reason to align them higher.
 - This roughly matches llvm-gcc's r126913.
 - It is an open question whether or not we should do this for cstring's in
   general (code size vs optimization potential), for now we just match llvm-gcc
   until someone wants to run some experiments.

llvm-svn: 129410
2011-04-12 23:30:52 +00:00
Jakob Stoklund Olesen 987164043c Add @earlyclobber constraints to the writeback register of all ARM store instructions.
The ARMARM specifies these instructions as unpredictable when storing the
writeback register. This shouldn't affect code generation much since storing a
pointer to itself is quite rare.

llvm-svn: 129409
2011-04-12 23:27:48 +00:00
Eric Christopher d829f43c06 Fix a bug where we were counting the alias sets as completely used
registers for fast allocation.

Fixes rdar://9207598

llvm-svn: 129408
2011-04-12 23:23:14 +00:00
Devang Patel 0e821f4673 I missed this new file in previous commit.
llvm-svn: 129407
2011-04-12 23:21:44 +00:00
Devang Patel 28dce70364 Simplify. There is no need to use static variable.
llvm-svn: 129406
2011-04-12 23:10:47 +00:00
Devang Patel 13d47f0ddc Do not reuse parameter name.
llvm-svn: 129405
2011-04-12 23:09:06 +00:00
Dan Gohman c8454ee995 Fix a hole in the definition of "dependence" used by trap values. Trap
values are also transmitted through branches which cause side effects to
be skipped altogether.

llvm-svn: 129404
2011-04-12 23:05:59 +00:00
Bill Wendling dbfde42468 Revert r129401 for now. Clang is using the old way of doing things.
llvm-svn: 129403
2011-04-12 22:59:27 +00:00
Devang Patel f20c4f715f This mechanical patch moves type handling into CompileUnit from DwarfDebug. In case of multiple compile unit in one object file, each compile unit is responsible for its own set of type entries anyway. This refactoring makes this obvious.
llvm-svn: 129402
2011-04-12 22:53:02 +00:00
Bill Wendling 47c24875a1 Remove the unaligned load intrinsics in favor of using native unaligned loads.
Now that we have a first-class way to represent unaligned loads, the unaligned
load intrinsics are superfluous.

First part of <rdar://problem/8460511>.

llvm-svn: 129401
2011-04-12 22:46:31 +00:00
Eric Christopher de9d58569f Add more comments... err debug statements to the fast allocator.
llvm-svn: 129400
2011-04-12 22:17:44 +00:00
Oscar Fuentes 80cd17c79f Fix compiler command line used by lit.py when working with NMake
generators. It may improve robustness when testing from VS too.

Based on a patch by David Neto!

llvm-svn: 129398
2011-04-12 22:10:38 +00:00
John McCall 58989b7125 We can't emit an aggregate cast as its sub-expression in general just
because the result is ignored.  The particular example here is with
property l-values, but there could be all sorts of lovely casts that this
isn't safe for.  Sink the check into the one case that seems to actually
be capable of honoring this.

llvm-svn: 129397
2011-04-12 22:02:02 +00:00
Daniel Dunbar a4e29a64d8 Driver: Don't treat -m{abi,arch,cpu,cmodel}= as "driver" options, they don't
modify the driver planning.

llvm-svn: 129396
2011-04-12 21:53:33 +00:00
Ted Kremenek ced5feaec9 Teach VariadicMethodTypeChecker to not crash when processing methods declared in protocols.
llvm-svn: 129395
2011-04-12 21:47:05 +00:00
Ted Kremenek 905a602e0c Fix another IdempotentOperationsChecker corner case when determining if an active block on the worklist
impacts the results of the check.

llvm-svn: 129394
2011-04-12 21:47:02 +00:00
Ted Kremenek f62a279e4c Provide options to explicitly enable/disable checkers in scan-build.
llvm-svn: 129393
2011-04-12 21:47:00 +00:00
Ted Kremenek 79c4c2baa9 Enable C++ static analysis support in ccc-analyzer.
llvm-svn: 129392
2011-04-12 21:46:57 +00:00
Johnny Chen 960eef3db3 The Thumb2 RFE instructions need to have their second halfword fully specified.
In addition, the base register is not rGPR, but GPR with th exception that:

    if n == 15 then UNPREDICTABLE

rdar://problem/9273836

llvm-svn: 129391
2011-04-12 21:41:51 +00:00
Jakob Stoklund Olesen c49df2c05a SparseBitVector is SLOW.
Use a Bitvector instead, we didn't need the smaller memory footprint anyway.
This makes the greedy register allocator 10% faster.

llvm-svn: 129390
2011-04-12 21:30:53 +00:00
Nick Kledzik aa60d6ac01 fix typo
llvm-svn: 129389
2011-04-12 21:22:48 +00:00
Jim Grosbach 733d305fee MCJIT lazy relocation resolution and symbol address re-assignment.
Add handling for tracking the relocations on symbols and resolving them.
Keep track of the relocations even after they are resolved so that if
the RuntimeDyld client moves the object, it can update the address and any
relocations to that object will be updated.

For our trival object file load/run test harness (llvm-rtdyld), this enables
relocations between functions located in the same object module. It should
be trivially extendable to load multiple objects with mutual references.

As a simple example, the following now works (running on x86_64 Darwin 10.6):


$ cat t.c
int bar() {
  return 65;
}

int main() {
  return bar();
}
$ clang t.c -fno-asynchronous-unwind-tables -o t.o -c
$ otool -vt t.o
t.o:
(__TEXT,__text) section
_bar:
0000000000000000  pushq %rbp
0000000000000001  movq  %rsp,%rbp
0000000000000004  movl  $0x00000041,%eax
0000000000000009  popq  %rbp
000000000000000a  ret
000000000000000b  nopl  0x00(%rax,%rax)
_main:
0000000000000010  pushq %rbp
0000000000000011  movq  %rsp,%rbp
0000000000000014  subq  $0x10,%rsp
0000000000000018  movl  $0x00000000,0xfc(%rbp)
000000000000001f  callq 0x00000024
0000000000000024  addq  $0x10,%rsp
0000000000000028  popq  %rbp
0000000000000029  ret
$ llvm-rtdyld t.o -debug-only=dyld ; echo $?
Function sym: '_bar' @ 0
Function sym: '_main' @ 16
Extracting function: _bar from [0, 15]
    allocated to 0x100153000
Extracting function: _main from [16, 41]
    allocated to 0x100154000
Relocation at '_main' + 16 from '_bar(Word1: 0x2d000000)
Resolving relocation at '_main' + 16 (0x100154010) from '_bar (0x100153000)(pcrel, type: 2, Size: 4).
loaded '_main' at: 0x100154000
65
$

llvm-svn: 129388
2011-04-12 21:20:41 +00:00
Johnny Chen 01637b9acb Add bad register checks for Thumb2 Ld/St instructions.
rdar://problem/9269047

llvm-svn: 129387
2011-04-12 21:17:51 +00:00
Nick Kledzik 191c2804e7 <rdar://problem/9185449> update version info for arm
llvm-svn: 129386
2011-04-12 21:11:47 +00:00
Andrew Trick 1b60ad6644 Revert 129383. It causes some targets to hit a scheduler assert.
llvm-svn: 129385
2011-04-12 20:14:07 +00:00
Nick Lewycky 2b473f8c85 Print our uint64_t with the more portable (C99 and C++0x) %PRIu64 format
specifier.

llvm-svn: 129384
2011-04-12 20:06:50 +00:00