Commit Graph

17609 Commits

Author SHA1 Message Date
Kostya Serebryany cf880b9443 Unify clang/llvm attributes for asan/tsan/msan (LLVM part)
These are two related changes (one in llvm, one in clang).
LLVM: 
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG: 
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176075
2013-02-26 06:58:09 +00:00
Michael Ilseman c33b6ac7c9 Use a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the pass-manager overhead from FPPassManager::runOnFunction() by about 10%.
llvm-svn: 176072
2013-02-26 01:31:59 +00:00
Bill Schmidt b454829981 Fix missing relocation for TLS addressing peephole optimization.
Report and fix due to Kai Nacke.  Testcase update by me.

llvm-svn: 176029
2013-02-25 16:44:35 +00:00
David Blaikie bbe0e1abe6 DIBuilder: support structs with vtable pointers in the same way as classes
llvm-svn: 176004
2013-02-25 01:07:18 +00:00
Eric Christopher 0dab36478a Add a field to the compile unit of where we plan on splitting out
the debug info for -gsplit-dwarf so we can encode that location
in the skeleton cu.

llvm-svn: 175933
2013-02-22 23:50:04 +00:00
Eric Christopher 8952471328 Add a TODO and explain when we can get rid of the isMain field.
llvm-svn: 175932
2013-02-22 23:50:01 +00:00
Eric Christopher a3da7a5879 Formatting.
llvm-svn: 175931
2013-02-22 23:49:58 +00:00
Benjamin Kramer 3abc30a497 An Optional<T> is pod-like if the inner type is.
llvm-svn: 175908
2013-02-22 18:58:26 +00:00
Bill Wendling 09bd1f71ee Implement the NoBuiltin attribute.
The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should
not treat the callee function as a built-in function. I.e., it shouldn't try to
replace that function with different code.

llvm-svn: 175835
2013-02-22 00:12:35 +00:00
David Blaikie 65615996b9 Limit cast machinery to preserve const and not accept temporaries
After cleaning up the following type hierarchies:
  * TypeLoc: r175462
  * SVal: r175594
  * CFGElement: r175462
  * ProgramPoint: r175812
that all invoked undefined behavior by causing a derived copy construction of a
base object through an invalid cast (thus supporting code that relied on
casting temporaries that were direct base objects) Clang/LLVM is now clean of
casts of temporaries. So here's some fun SFINAE machinery (courtesy of Eli
Friedman, with some porting back from C++11 to LLVM's traits by me) to cause
compile-time failures if llvm::cast & friends are ever passed an rvalue.

This should avoid a repeat of anything even remotely like PR14321/r168124.

Thanks to Jordan Rose for the help with the various Static Analyzer related
hierarchies that needed cleaning up, Eli for the SFINAE, Richard Smith, John
McCall, Ted Kremenek, and Anna Zaks for their input/reviews/patience along the
way.

llvm-svn: 175819
2013-02-21 22:48:34 +00:00
Pedro Artigas 699cf390ff Clear the whole table including the tombstones, since the tombstone count will
be set to zero that is what it was intended. Should improve performance of 
the data structure when clear is invoked frequently (both compile time and
memory usage).

llvm-svn: 175799
2013-02-21 21:32:00 +00:00
Eli Bendersky 8da87163ca Move the eliminateCallFramePseudoInstr method from TargetRegisterInfo
to TargetFrameLowering, where it belongs. Incidentally, this allows us
to delete some duplicated (and slightly different!) code in TRI.

There are potentially other layering problems that can be cleaned up
as a result, or in a similar manner.

The refactoring was OK'd by Anton Korobeynikov on llvmdev.

Note: this touches the target interfaces, so out-of-tree targets may
be affected.

llvm-svn: 175788
2013-02-21 20:05:00 +00:00
Jakob Stoklund Olesen 2ff4dc0ff2 Make RAFast::UsedInInstr indexed by register units.
This fixes some problems with too conservative checking where we were
marking all aliases of a register as used, and then also checking all
aliases when allocating a register.

<rdar://problem/13249625>

llvm-svn: 175782
2013-02-21 19:35:21 +00:00
David Blaikie 1bcb538c3f Add move ctor/assignment to Optional<T>
Code review feedback for r175580 by Jordan Rose.

llvm-svn: 175729
2013-02-21 07:55:39 +00:00
David Blaikie 654aa755ae Correct spelling of 'enumerator'.
Post commit code review feedback to r175705 from Jordan Rose.

llvm-svn: 175724
2013-02-21 06:08:22 +00:00
David Blaikie 86d88f7168 Make Optional<T>'s operator bool 'explicit' in C++11
Provides a general way to add 'explicit' for conversion operators (a no-op when
compiling as C++98).

llvm-svn: 175723
2013-02-21 06:05:57 +00:00
NAKAMURA Takumi 8c5d388850 ADT/Optional.h: Appease msvc. It reapplies r175626.
llvm-svn: 175710
2013-02-21 02:32:25 +00:00
David Blaikie ef04593de1 Provide a "None" value for convenience when using Optional<T>()
This implementation of NoneType/None does have some holes but I haven't
found one that doesn't - open to improvement.

llvm-svn: 175696
2013-02-21 00:27:28 +00:00
Jim Grosbach d2037eb1ee MCParser: Update method names per coding guidelines.
s/AddDirectiveHandler/addDirectiveHandler/
s/ParseMSInlineAsm/parseMSInlineAsm/
s/ParseIdentifier/parseIdentifier/
s/ParseStringToEndOfStatement/parseStringToEndOfStatement/
s/ParseEscapedString/parseEscapedString/
s/EatToEndOfStatement/eatToEndOfStatement/
s/ParseExpression/parseExpression/
s/ParseParenExpression/parseParenExpression/
s/ParseAbsoluteExpression/parseAbsoluteExpression/
s/CheckForValidSection/checkForValidSection/

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

No functional change intended.

llvm-svn: 175675
2013-02-20 22:21:35 +00:00
Jim Grosbach 341ad3e72a Update TargetLowering ivars for name policy.
http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

ivars should be camel-case and start with an upper-case letter. A few in
TargetLowering were starting with a lower-case letter.

No functional change intended.

llvm-svn: 175667
2013-02-20 21:13:59 +00:00
Jakob Stoklund Olesen 623d8329e3 Use LiveRangeUpdater instead of mergeIntervalRanges.
Performance is the same, but LiveRangeUpdater has a more flexible
interface.

llvm-svn: 175645
2013-02-20 18:18:15 +00:00
Jakob Stoklund Olesen 521c708e6e Add a LiveRangeUpdater class.
Adding new segments to large LiveIntervals can be expensive because the
LiveRange objects after the insertion point may need to be moved left or
right. This can cause quadratic behavior when adding a large number of
segments to a live range.

The LiveRangeUpdater class allows the LIveInterval to be in a temporary
invalid state while segments are being added. It maintains an internal
gap in the LiveInterval when it is shrinking, and it has a spill area
for new segments when the LiveInterval is growing.

The behavior is similar to the existing mergeIntervalRanges() function,
except it allocates less memory for the spill area, and the algorithm is
turned inside out so the loop is driven by the clients.

llvm-svn: 175644
2013-02-20 18:18:12 +00:00
Jakob Stoklund Olesen 14a32d8682 Add a default constructor for LiveRange.
It is useful to be able to create temporary LiveRange object whose
members are filled in later.

llvm-svn: 175639
2013-02-20 17:46:51 +00:00
NAKAMURA Takumi f4652c32e8 Revert r175626, "ADT/Optional.h: Appease msvc."
Sorry, I didn't cover +Asserts, by accident. :(

llvm-svn: 175633
2013-02-20 15:52:44 +00:00
NAKAMURA Takumi 3389c55e10 Whitespace.
llvm-svn: 175627
2013-02-20 15:12:32 +00:00
NAKAMURA Takumi da782f58ab ADT/Optional.h: Appease msvc.
llvm-svn: 175626
2013-02-20 15:12:24 +00:00
Benjamin Kramer 5c3e21ba55 Move the SplatByte helper to APInt and generalize it a bit.
llvm-svn: 175621
2013-02-20 13:00:06 +00:00
Cameron Zwarich c04679f033 Modify LiveInterval::addRange() to match the comment about what it returns.
llvm-svn: 175602
2013-02-20 06:46:44 +00:00
Cameron Zwarich 2941482387 Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after adding
and removing instructions. The implementation seems more complicated than it
needs to be, but I couldn't find something simpler that dealt with all of the
corner cases.

Also add a call to repairIndexesInRange() from repairIntervalsInRange().

llvm-svn: 175601
2013-02-20 06:46:41 +00:00
Cameron Zwarich 26ef663c42 Make SlotIndex::getEntry() return unsigned to match IndexListEntry.
llvm-svn: 175600
2013-02-20 06:46:39 +00:00
Cameron Zwarich 11e8d50891 Fix a misunderstanding about how RegMaskBlocks works. This was caught by
assertions in the register allocator when running 'make check' without
LiveVariables.

llvm-svn: 175599
2013-02-20 06:46:36 +00:00
David Blaikie 532aff8cd0 Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.
Code review feedback on r175580 from Jordan Rose.

llvm-svn: 175595
2013-02-20 06:25:36 +00:00
Michael J. Spencer 6a8746b7e6 [llvm-readobj] Add ELF .dynamic table dumping.
llvm-svn: 175592
2013-02-20 02:37:12 +00:00
Jakub Staszak cab3dfb650 Remove unneeded #include.
llvm-svn: 175584
2013-02-20 00:32:19 +00:00
Jakub Staszak 8bc7af1a93 Fix #includes, so we include only what we really need.
llvm-svn: 175581
2013-02-20 00:26:25 +00:00
David Blaikie 77bac3dbcc Allow llvm::Optional to work with types without default constructors.
This generalizes Optional to require less from the T type by using aligned
storage for backing & placement new/deleting the T into it when necessary.

Also includes unit tests.

llvm-svn: 175580
2013-02-20 00:26:04 +00:00
Jakub Staszak 6605c604b9 Move part of APInt implementation from header to cpp file. These methods
require call cpp file anyway, so we wouldn't gain anything by keeping them
inline.

llvm-svn: 175579
2013-02-20 00:17:42 +00:00
Jack Carter 10c97e5ca0 ELF symbol table field st_other support,
excluding visibility bits.

Mips (o32 abi) specific e_header setting.

EF_MIPS_ABI_O32 needs to be set in the 
ELF header flags for o32 abi output.

Contributer: Reed Kotler
llvm-svn: 175569
2013-02-19 22:29:00 +00:00
Jack Carter 1ba1f3cec8 ELF symbol table field st_other support,
excluding visibility bits.

Mips (Mips16) specific e_header setting.

EF_MIPS_ARCH_ASE_M16 needs to be set in the 
ELF header flags for Mips16.

Contributer: Reed Kotler
llvm-svn: 175566
2013-02-19 22:14:34 +00:00
Jack Carter ab3cb425aa ELF symbol table field st_other support,
excluding visibility bits.

Mips (MicroMips) specific STO handling .

The st_other field settig for STO_MIPS_MICROMIPS

Contributer: Zoran Jovanovic
llvm-svn: 175564
2013-02-19 22:04:37 +00:00
Jack Carter 2f8d9d913c ELF symbol table field st_other support,
excluding visibility bits.

Generic STO handling at the Target level.

The st_other field of the ELF symbol table is one
byte in size. The first 2 bytes are used for generic
visibility and are currently handled by llvm.

The other six bits are processor specific and need 
to be set at the target level.

A couple of notes:

The new static methods for accessing and setting the "other"
flags in include/llvm/MC/MCELF.h match the style guide
and not the other methods in the file. I don't like the
inconsistency, but feel I should follow the prescribed 
lowerUpper() convention.

STO_ value definitions are not specified in gnu land as 
consistently as the STT_ and STB_ fields. Probably because
the latter were defined in a standards doc and the former
defined partially in code. I have stuck with the full byte
definition of the flags.

Contributer: Zoran Jovanovic
llvm-svn: 175561
2013-02-19 21:57:35 +00:00
Jakub Staszak 5f2fb6d9d1 Simplify code. No functionality change.
llvm-svn: 175559
2013-02-19 21:49:54 +00:00
Nadav Rotem 0186347c4c Fix a bug in mayHaveSideEffects. Functions that do not return are now considered as instructions with side effects.
rdar://13227456

llvm-svn: 175553
2013-02-19 20:02:09 +00:00
Douglas Gregor b1c67569c3 Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.
llvm-svn: 175538
2013-02-19 18:26:07 +00:00
Alexey Samsonov f940f0c417 Fix initialization-order bug in llvm::Support::TimeValue. TimeValue::now() is explicitly called during module initialization of lib/Support/Process.cpp. It reads the field of global object PosixZeroTime, which is not guaranteed to be initialized at this point. Found by AddressSanitizer with -fsanitize=init-order option.
llvm-svn: 175509
2013-02-19 11:35:39 +00:00
Eric Christopher 362eb1fca3 Grammar.
llvm-svn: 175493
2013-02-19 06:23:44 +00:00
Bill Wendling c1f9640013 Add some convenience methods for querying function attributes.
llvm-svn: 175469
2013-02-18 23:16:42 +00:00
David Blaikie 772d4f75f6 Use LLVM_DELETED_FUNCTION rather than '// do not implement' comments.
Also removes some redundant DNI comments on function declarations already
using the macro.

llvm-svn: 175466
2013-02-18 23:11:17 +00:00
Benjamin Kramer 53bc37ca2a Support for HiPE-compatible code emission, patch by Yiannis Tsiouris.
llvm-svn: 175457
2013-02-18 20:55:12 +00:00
Jakub Staszak 39c0ad7515 Use llvm::cast instead of reinterpret_cast.
Also, GetElementPtrInst::getType() method returns SequentialType now, instead of
PointerType. There wasn't any issue yet, so no testcase attached.

llvm-svn: 175452
2013-02-18 18:49:44 +00:00