| #
70bc5f13 |
| 19-Jun-2015 |
Alexander Kornienko <[email protected]> |
Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-c
Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/
Thanks to Eugene Kosov for the original patch!
llvm-svn: 240137
show more ...
|
| #
7fddeccb |
| 17-Jun-2015 |
David Majnemer <[email protected]> |
Move the personality function from LandingPadInst to Function
The personality routine currently lives in the LandingPadInst.
This isn't desirable because: - All LandingPadInsts in the same function
Move the personality function from LandingPadInst to Function
The personality routine currently lives in the LandingPadInst.
This isn't desirable because: - All LandingPadInsts in the same function must have the same personality routine. This means that each LandingPadInst beyond the first has an operand which produces no additional information.
- There is ongoing work to introduce EH IR constructs other than LandingPadInst. Moving the personality routine off of any one particular Instruction and onto the parent function seems a lot better than have N different places a personality function can sneak onto an exceptional function.
Differential Revision: http://reviews.llvm.org/D10429
llvm-svn: 239940
show more ...
|
| #
456baad2 |
| 17-Jun-2015 |
Rafael Espindola <[email protected]> |
Handle forward referenced function when streaming bitcode.
Without this the included unit test would assert in
assert(BasicBlockFwdRefs.empty() && "Unresolved blockaddress fwd references");
llvm
Handle forward referenced function when streaming bitcode.
Without this the included unit test would assert in
assert(BasicBlockFwdRefs.empty() && "Unresolved blockaddress fwd references");
llvm-svn: 239871
show more ...
|
| #
728074b7 |
| 17-Jun-2015 |
Rafael Espindola <[email protected]> |
Handle MaterializeAll in getLazyBitcodeModuleImpl. NFC.
This just handles both cases in the same place.
Extracted from a patch by Karl Schimpf.
llvm-svn: 239870
|
| #
1aabf982 |
| 16-Jun-2015 |
Rafael Espindola <[email protected]> |
Use std::unique_ptr to manage the DataStreamer in bitcode parsing.
We were already deleting it, this just makes it explicit.
llvm-svn: 239867
|
| #
dcd1dca2 |
| 16-Jun-2015 |
Rafael Espindola <[email protected]> |
Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC.
llvm-svn: 239858
|
| #
c6afe0d4 |
| 16-Jun-2015 |
Rafael Espindola <[email protected]> |
Improve handling of end of file in the bitcode reader.
Before this patch the bitcode reader would read a module from a file that contained in order:
* Any number of non MODULE_BLOCK sub blocks. * O
Improve handling of end of file in the bitcode reader.
Before this patch the bitcode reader would read a module from a file that contained in order:
* Any number of non MODULE_BLOCK sub blocks. * One MODULE_BLOCK * Any number of non MODULE_BLOCK sub blocks. * 4 '\n' characters to handle OS X's ranlib.
Since we support lazy reading of modules, any information that is relevant for the module has to be in the MODULE_BLOCK or before it. We don't gain anything from checking what is after.
This patch then changes the reader to stop once the MODULE_BLOCK has been successfully parsed.
This avoids the ugly special case for .bc files in an archive and makes it easier to embed bitcode files.
llvm-svn: 239845
show more ...
|
| #
82437bf7 |
| 15-Jun-2015 |
Peter Collingbourne <[email protected]> |
Protection against stack-based memory corruption errors using SafeStack
This patch adds the safe stack instrumentation pass to LLVM, which separates the program stack into a safe stack, which stores
Protection against stack-based memory corruption errors using SafeStack
This patch adds the safe stack instrumentation pass to LLVM, which separates the program stack into a safe stack, which stores return addresses, register spills, and local variables that are statically verified to be accessed in a safe way, and the unsafe stack, which stores everything else. Such separation makes it much harder for an attacker to corrupt objects on the safe stack, including function pointers stored in spilled registers and return addresses. You can find more information about the safe stack, as well as other parts of or control-flow hijack protection technique in our OSDI paper on code-pointer integrity (http://dslab.epfl.ch/pubs/cpi.pdf) and our project website (http://levee.epfl.ch).
The overhead of our implementation of the safe stack is very close to zero (0.01% on the Phoronix benchmarks). This is lower than the overhead of stack cookies, which are supported by LLVM and are commonly used today, yet the security guarantees of the safe stack are strictly stronger than stack cookies. In some cases, the safe stack improves performance due to better cache locality.
Our current implementation of the safe stack is stable and robust, we used it to recompile multiple projects on Linux including Chromium, and we also recompiled the entire FreeBSD user-space system and more than 100 packages. We ran unit tests on the FreeBSD system and many of the packages and observed no errors caused by the safe stack. The safe stack is also fully binary compatible with non-instrumented code and can be applied to parts of a program selectively.
This patch is our implementation of the safe stack on top of LLVM. The patches make the following changes:
- Add the safestack function attribute, similar to the ssp, sspstrong and sspreq attributes.
- Add the SafeStack instrumentation pass that applies the safe stack to all functions that have the safestack attribute. This pass moves all unsafe local variables to the unsafe stack with a separate stack pointer, whereas all safe variables remain on the regular stack that is managed by LLVM as usual.
- Invoke the pass as the last stage before code generation (at the same time the existing cookie-based stack protector pass is invoked).
- Add unit tests for the safe stack.
Original patch by Volodymyr Kuznetsov and others at the Dependable Systems Lab at EPFL; updates and upstreaming by myself.
Differential Revision: http://reviews.llvm.org/D6094
llvm-svn: 239761
show more ...
|
| #
64a27fb8 |
| 15-Jun-2015 |
Rafael Espindola <[email protected]> |
Don't indent inside a namespace. NFC.
llvm-svn: 239760
|
| #
6ace6855 |
| 15-Jun-2015 |
Rafael Espindola <[email protected]> |
Replace @ with the more common \. NFC.
llvm-svn: 239759
|
| #
cbdcb505 |
| 15-Jun-2015 |
Rafael Espindola <[email protected]> |
Don't repeat names in comments and start functions with a lower case letter.
llvm-svn: 239756
|
| #
4223a1f8 |
| 15-Jun-2015 |
Rafael Espindola <[email protected]> |
Cleanup the constructor of BitcodeReader. NFC.
Use the same argument names as the members. Use default member initializes.
Extracted from a patch by Karl Schimpf.
llvm-svn: 239749
|
| #
ef5e7add |
| 12-Jun-2015 |
Yaron Keren <[email protected]> |
Rangify two for loops in BitcodeReader.cpp.
llvm-svn: 239627
|
| #
a911af0e |
| 06-Jun-2015 |
Filipe Cabecinhas <[email protected]> |
Use early return idiom. NFC
llvm-svn: 239228
|
| #
da86b6d4 |
| 03-Jun-2015 |
Filipe Cabecinhas <[email protected]> |
[BitcodeReader] Diagnose type mismatches with aliases
Bug found with AFL fuzz.
llvm-svn: 238895
|
| #
8e42190d |
| 03-Jun-2015 |
Filipe Cabecinhas <[email protected]> |
[BitcodeReader] Check vector size before trying to create a VectorType
Bug found with AFL fuzz
llvm-svn: 238891
|
| #
14e68677 |
| 30-May-2015 |
Filipe Cabecinhas <[email protected]> |
[BitcodeReader] Change an assert to a call to a call to Error()
It's reachable from user input.
Bug found with AFL fuzz.
llvm-svn: 238633
|
| #
f5e2fc47 |
| 29-May-2015 |
Benjamin Kramer <[email protected]> |
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of charact
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters.
Call sites were found with the ASTMatcher + some semi-automated cleanup.
memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation()))
No functional change intended.
llvm-svn: 238602
show more ...
|
| #
6a92a3fe |
| 27-May-2015 |
Filipe Cabecinhas <[email protected]> |
[BitcodeReader] Change assert to report_fatal_error
It can be triggered by user input.
Bug found with AFL fuzz.
llvm-svn: 238272
|
| #
85fa7d50 |
| 26-May-2015 |
Owen Anderson <[email protected]> |
Add initial support for the convergent attribute.
llvm-svn: 238264
|
| #
0eb8a59a |
| 26-May-2015 |
Filipe Cabecinhas <[email protected]> |
[BitcodeReader] Sanity check on Comdat ID
Shouldn't be an assert, since user input can trigger it.
Bug found with AFL fuzz.
llvm-svn: 238261
|
| #
1f599f9f |
| 21-May-2015 |
Adrian Prantl <[email protected]> |
IR / debug info: Add a DWOId field to DICompileUnit, so DWARF skeleton CUs can be expression in IR. A skeleton CU is a (typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and a DW_A
IR / debug info: Add a DWOId field to DICompileUnit, so DWARF skeleton CUs can be expression in IR. A skeleton CU is a (typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and a DW_AT_(GNU)_dwo_id attribute. It is used to refer to external debug info.
This is a prerequisite for clang module debugging as discussed in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html. In order to refer to external types stored in split DWARF (dwo) objects, such as clang modules, we need to emit skeleton CUs, which identify the dwarf object (i.e., the clang module) by filename (the SplitDebugFilename) and a hash value, the dwo_id.
This patch only contains the IR changes. The idea is that a CUs with a non-zero dwo_id field will be emitted together with a DW_AT_GNU_dwo_name and DW_AT_GNU_dwo_id attribute.
http://reviews.llvm.org/D9488 rdar://problem/20091852
llvm-svn: 237949
show more ...
|
| #
32af5421 |
| 19-May-2015 |
Filipe Cabecinhas <[email protected]> |
[BitcodeReader] Error out if we read an invalid function argument type
Bug found with AFL fuzz.
llvm-svn: 237650
|
| #
4708a02a |
| 18-May-2015 |
Filipe Cabecinhas <[email protected]> |
[BitcodeReader] Make sure the type of the inserted value matches the type of the aggregate at those indices
Bug found with AFL-fuzz.
llvm-svn: 237628
|
| #
11bb8495 |
| 18-May-2015 |
Filipe Cabecinhas <[email protected]> |
Extract the load/store type verification to a separate function.
Summary: Added isLoadableOrStorableType to PointerType.
We were doing some checks in some places, occasionally assert()ing instead o
Extract the load/store type verification to a separate function.
Summary: Added isLoadableOrStorableType to PointerType.
We were doing some checks in some places, occasionally assert()ing instead of telling the caller. With this patch, I'm putting all type checking in the same place for load/store type instructions, and verifying the same thing every time.
I also added a check for load/store of a function type.
Applied extracted check to Load, Store, and Cmpxcg.
I don't have exhaustive tests for all of these, but all Error() calls in TypeCheckLoadStoreInst are being tested (in invalid.test).
Reviewers: dblaikie, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9785
llvm-svn: 237619
show more ...
|