History log of /llvm-project-15.0.7/clang/lib/CodeGen/CGExpr.cpp (Results 451 – 475 of 1262)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 7c5da41c 10-Dec-2014 David Blaikie <[email protected]>

DebugInfo: Correct location information for array accesses to elements of variable array type.

llvm-svn: 223902


# d85548d4 10-Dec-2014 David Blaikie <[email protected]>

DebugInfo: Fix another case of array access line information

llvm-svn: 223897


# f0aceb2f 10-Dec-2014 David Blaikie <[email protected]>

DebugInfo: Correct the location of array accesses

Especially relevant to ASan when dealing with complex expressions
containing multiple array accesses. See PR21737.

llvm-svn: 223872


# fb494914 09-Dec-2014 Duncan P. N. Exon Smith <[email protected]>

IR: Update clang for Metadata/Value split in r223802

Match LLVM API changes from r223802.

llvm-svn: 223803


Revision tags: llvmorg-3.5.1-rc1
# 73ca5694 09-Dec-2014 David Blaikie <[email protected]>

DebugInfo: Correctly identify the location of C++ member initializer list elements

This particularly helps the fidelity of ASan reports (which can occur
even in these examples - if, for example, one

DebugInfo: Correctly identify the location of C++ member initializer list elements

This particularly helps the fidelity of ASan reports (which can occur
even in these examples - if, for example, one uses placement new over a
buffer of insufficient size - now ASan will correctly identify which
member's initialization went over the end of the buffer).

This doesn't cover all types of members - more coming.

llvm-svn: 223726

show more ...


# 0b7fad65 08-Dec-2014 David Blaikie <[email protected]>

DebugInfo: Ensure the store for an assignment is attributed to the beginning of the assignment expression

llvm-svn: 223699


# 68e79383 14-Nov-2014 Fariborz Jahanian <[email protected]>

This patch fixes couple of bugs for predefined expression
used inside blocks. It fixes a crash in naming code
for __func__ etc. when used in a block declared globally.
It also brings back old naming

This patch fixes couple of bugs for predefined expression
used inside blocks. It fixes a crash in naming code
for __func__ etc. when used in a block declared globally.
It also brings back old naming convention for
predefined expression which was broken. rdar://18961148

llvm-svn: 222065

show more ...


# e396bfc0 11-Nov-2014 Alexey Samsonov <[email protected]>

Bundle conditions checked by UBSan with sanitizer kinds they implement.

Summary:
This change makes CodeGenFunction::EmitCheck() take several
conditions that needs to be checked (all of them need to

Bundle conditions checked by UBSan with sanitizer kinds they implement.

Summary:
This change makes CodeGenFunction::EmitCheck() take several
conditions that needs to be checked (all of them need to be true),
together with sanitizer kinds these checks are for. This would allow
to split one call into UBSan runtime into several calls in case
different sanitizer kinds would have different recoverability
settings.

Tests should be fixed accordingly, I'm working on it.

Test Plan: regression test suite.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6219

llvm-svn: 221716

show more ...


# 9772000a 11-Nov-2014 Alexey Bataev <[email protected]>

[OPENMP] Codegen for threadprivate variables
For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Ori

[OPENMP] Codegen for threadprivate variables
For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>);
In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>);
Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info.
Differential Revision: http://reviews.llvm.org/D4002

llvm-svn: 221663

show more ...


# 17d6094d 11-Nov-2014 NAKAMURA Takumi <[email protected]>

CGExpr.cpp: Suppress a warning. [-Wunused-variable]

llvm-svn: 221655


# 4c1a96f5 10-Nov-2014 Alexey Samsonov <[email protected]>

Propagate SanitizerKind into CodeGenFunction::EmitCheck() call.

Make sure CodeGenFunction::EmitCheck() knows which sanitizer
it emits check for. Make CheckRecoverableKind enum an
implementation deta

Propagate SanitizerKind into CodeGenFunction::EmitCheck() call.

Make sure CodeGenFunction::EmitCheck() knows which sanitizer
it emits check for. Make CheckRecoverableKind enum an
implementation detail and move it away from header.

Currently CheckRecoverableKind is determined by the type of
sanitizer ("unreachable" and "return" are unrecoverable,
"vptr" is always-recoverable, all the rest are recoverable).
This will change in future if we allow to specify which sanitizers
are recoverable, and which are not by -fsanitize-recover= flag.

No functionality change.

llvm-svn: 221635

show more ...


# edf99a92 07-Nov-2014 Alexey Samsonov <[email protected]>

Introduce a SanitizerKind enum to LangOptions.

Use the bitmask to store the set of enabled sanitizers instead of a
bitfield. On the negative side, it makes syntax for querying the
set of enabled san

Introduce a SanitizerKind enum to LangOptions.

Use the bitmask to store the set of enabled sanitizers instead of a
bitfield. On the negative side, it makes syntax for querying the
set of enabled sanitizers a bit more clunky. On the positive side, we
will be able to use SanitizerKind to eventually implement the
new semantics for -fsanitize-recover= flag, that would allow us
to make some sanitizers recoverable, and some non-recoverable.

No functionality change.

llvm-svn: 221558

show more ...


# 035462c1 30-Oct-2014 Alexey Samsonov <[email protected]>

Get rid of SanitizerOptions::Disabled global. NFC.

SanitizerOptions is not even a POD now, so having global variable of
this type, is not nice. Instead, provide a regular constructor and clear()
met

Get rid of SanitizerOptions::Disabled global. NFC.

SanitizerOptions is not even a POD now, so having global variable of
this type, is not nice. Instead, provide a regular constructor and clear()
method, and let each CodeGenFunction has its own copy of SanitizerOptions
it uses.

llvm-svn: 220920

show more ...


# b31b94a8 24-Oct-2014 Saleem Abdulrasool <[email protected]>

CodeGen: correct materialize temporary aggregates in ARC mode

Avoid an assertion when materializing a lifetime type aggregate temporary. When
performing CodeGen for ObjC++, we could generate a life

CodeGen: correct materialize temporary aggregates in ARC mode

Avoid an assertion when materializing a lifetime type aggregate temporary. When
performing CodeGen for ObjC++, we could generate a lifetime-only aggregate
temporary by using an initializer list (which is effectively an array). We
would reach through the temporary expression, fishing out the inner expression.
If this expression was a lifetime expression, we would attempt to emit this as a
scalar. This would eventually result in an assertion as the emission would
eventually assert that the expression being emitted has a scalar evaluation
kind.

Add a case to handle the aggregate expressions. Use the EmitAggExpr to emit the
aggregate expression rather than the EmitScalarInit.

Addresses PR21347.

llvm-svn: 220590

show more ...


# 8925dc0a 24-Oct-2014 Saleem Abdulrasool <[email protected]>

CodeGen: trivial conversion to range based loop

Switch to a range-based for loop. NFC.

llvm-svn: 220587


# 1444bb9f 17-Oct-2014 Alexey Samsonov <[email protected]>

SanitizerBlacklist: blacklist functions by their source location.

This commit changes the way we blacklist functions in ASan, TSan,
MSan and UBSan. We used to treat function as "blacklisted"
and tur

SanitizerBlacklist: blacklist functions by their source location.

This commit changes the way we blacklist functions in ASan, TSan,
MSan and UBSan. We used to treat function as "blacklisted"
and turned off instrumentation in it in two cases:

1) Function is explicitly blacklisted by its mangled name.
This part is not changed.

2) Function is located in llvm::Module, whose identifier is
contained in the list of blacklisted sources. This is completely
wrong, as llvm::Module may not correspond to the actual source
file function is defined in. Also, function can be defined in
a header, in which case user had to blacklist the .cpp file
this header was #include'd into, not the header itself.
Such functions could cause other problems - for instance, if the
header was included in multiple source files, compiled
separately and linked into a single executable, we could end up
with both instrumented and non-instrumented version of the same
function participating in the same link.

After this change we will make blacklisting decision based on
the SourceLocation of a function definition. If a function is
not explicitly defined in the source file, (for example, the
function is compiler-generated and responsible for
initialization/destruction of a global variable), then it will
be blacklisted if the corresponding global variable is defined
in blacklisted source file, and will be instrumented otherwise.

After this commit, the active users of blacklist files may have
to revisit them. This is a backwards-incompatible change, but
I don't think it's possible or makes sense to support the
old incorrect behavior.

I plan to make similar change for blacklisting GlobalVariables
(which is ASan-specific).

llvm-svn: 219997

show more ...


# 6fae8495 15-Oct-2014 Hal Finkel <[email protected]>

Moving CGF::EmitAlignmentAssumption to IRBuilder

The functionality contained in CodeGenFunction::EmitAlignmentAssumption has
been moved to IRBuilder (so that it can also be used by LLVM-level code).

Moving CGF::EmitAlignmentAssumption to IRBuilder

The functionality contained in CodeGenFunction::EmitAlignmentAssumption has
been moved to IRBuilder (so that it can also be used by LLVM-level code).
Remove this now-duplicate implementation in favor of the IRBuilder code.

llvm-svn: 219877

show more ...


# eb47d8a2 13-Oct-2014 Alexey Samsonov <[email protected]>

Sanitize upcasts and conversion to virtual base.

This change adds UBSan check to upcasts. Namely, when we
perform derived-to-base conversion, we:
1) check that the pointer-to-derived has suitable al

Sanitize upcasts and conversion to virtual base.

This change adds UBSan check to upcasts. Namely, when we
perform derived-to-base conversion, we:
1) check that the pointer-to-derived has suitable alignment
and underlying storage, if this pointer is non-null.
2) if vptr-sanitizer is enabled, and we perform conversion to
virtual base, we check that pointer-to-derived has a matching vptr.

llvm-svn: 219642

show more ...


# 5d1159eb 10-Oct-2014 Nick Lewycky <[email protected]>

Revert r218865 because it introduced PR21236, a crash in codegen emitting the try block.

llvm-svn: 219470


# ec474780 09-Oct-2014 Alexey Bataev <[email protected]>

Fix for bug http://llvm.org/PR17427.
Assertion failed: "Computed __func__ length differs from type!"
Reworked PredefinedExpr representation with internal StringLiteral field for function declaration.

Fix for bug http://llvm.org/PR17427.
Assertion failed: "Computed __func__ length differs from type!"
Reworked PredefinedExpr representation with internal StringLiteral field for function declaration.
Differential Revision: http://reviews.llvm.org/D5365

llvm-svn: 219393

show more ...


# 453e0564 08-Oct-2014 Reid Kleckner <[email protected]>

Fix IRGen for referencing a static local before emitting its decl

Summary:
Previously CodeGen assumed that static locals were emitted before they
could be accessed, which is true for automatic stora

Fix IRGen for referencing a static local before emitting its decl

Summary:
Previously CodeGen assumed that static locals were emitted before they
could be accessed, which is true for automatic storage duration locals.
However, it is possible to have CodeGen emit a nested function that uses
a static local before emitting the function that defines the static
local, breaking that assumption.

Fix it by creating the static local upon access and ensuring that the
deferred function body gets emitted. We may not be able to emit the
initializer properly from outside the function body, so don't try.

Fixes PR18020. See also previous attempts to fix static locals in
PR6769 and PR7101.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4787

llvm-svn: 219265

show more ...


# b3341ea4 05-Oct-2014 David Majnemer <[email protected]>

MS ABI: Implement thread_local for global variables

Summary:
This add support for the C++11 feature, thread_local global variables.
The ABI Clang implements is an improvement of the MSVC ABI. Sadly

MS ABI: Implement thread_local for global variables

Summary:
This add support for the C++11 feature, thread_local global variables.
The ABI Clang implements is an improvement of the MSVC ABI. Sadly,
further improvements could be made but not without sacrificing ABI
compatibility.

The feature is implemented as follows:
- All thread_local initialization routines are pointed to from the
.CRT$XDU section.
- All non-weak thread_local variables have their initialization routines
call from a single function instead of getting their own .CRT$XDU
section entry. This is done to open up optimization opportunities to
the compiler.
- All weak thread_local variables have their own .CRT$XDU section entry.
This entry is in a COMDAT with the global variable it is initializing;
this ensures that we will initialize the global exactly once.
- Destructors are registered in the initialization function using
__tlregdtor.

Differential Revision: http://reviews.llvm.org/D5597

llvm-svn: 219074

show more ...


# 42d314d1 02-Oct-2014 Arnaud A. de Grandmaison <[email protected]>

Emit lifetime.start / lifetime.end markers for unnamed temporary objects.

This will give more information to the optimizers so that they can reuse stack slots
and reduce stack usage.

llvm-svn: 2188

Emit lifetime.start / lifetime.end markers for unnamed temporary objects.

This will give more information to the optimizers so that they can reuse stack slots
and reduce stack usage.

llvm-svn: 218865

show more ...


# 1ac0ec86 11-Sep-2014 Rafael Espindola <[email protected]>

Merge GetAddrOfCXXConstructor and GetAddrOfCXXDonstructor. NFC.

llvm-svn: 217598


# 8e1162c7 08-Sep-2014 Alexey Samsonov <[email protected]>

Implement nonnull-attribute sanitizer

Summary:
This patch implements a new UBSan check, which verifies
that function arguments declared to be nonnull with __attribute__((nonnull))
are actually nonnu

Implement nonnull-attribute sanitizer

Summary:
This patch implements a new UBSan check, which verifies
that function arguments declared to be nonnull with __attribute__((nonnull))
are actually nonnull in runtime.

To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs
(where applicable) and if function declaration has nonnull attribute specified
for a certain formal parameter, we compare the corresponding RValue to null as
soon as it's calculated.

Test Plan: regression test suite

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, rnk

Differential Revision: http://reviews.llvm.org/D5082

llvm-svn: 217389

show more ...


1...<<11121314151617181920>>...51