History log of /llvm-project-15.0.7/clang/lib/CodeGen/CGExprConstant.cpp (Results 51 – 75 of 479)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# a971003e 17-May-2019 Chris Bieneman <[email protected]>

Revert Refactor constant evaluation of typeid(T) to track a symbolic type_info object rather than tracking the originating expression.

This reverts r360974 (git commit 7ee4307bd4450022c3c8777f43a40c

Revert Refactor constant evaluation of typeid(T) to track a symbolic type_info object rather than tracking the originating expression.

This reverts r360974 (git commit 7ee4307bd4450022c3c8777f43a40cc4f0ccc009)

llvm-svn: 360988

show more ...


# 7ee4307b 17-May-2019 Richard Smith <[email protected]>

Refactor constant evaluation of typeid(T) to track a symbolic type_info
object rather than tracking the originating expression.

This is groundwork for supporting polymorphic typeid expressions. (Not

Refactor constant evaluation of typeid(T) to track a symbolic type_info
object rather than tracking the originating expression.

This is groundwork for supporting polymorphic typeid expressions. (Note
that this somewhat regresses our support for DR1968, but it turns out
that that never actually worked anyway, at least in non-trivial cases.)

llvm-svn: 360974

show more ...


Revision tags: llvmorg-8.0.1-rc1
# 708afb56 16-May-2019 Eric Fiselier <[email protected]>

Implement __builtin_LINE() et. al. to support source location capture.

Summary:
This patch implements the source location builtins `__builtin_LINE(), `__builtin_FUNCTION()`, `__builtin_FILE()` and `

Implement __builtin_LINE() et. al. to support source location capture.

Summary:
This patch implements the source location builtins `__builtin_LINE(), `__builtin_FUNCTION()`, `__builtin_FILE()` and `__builtin_COLUMN()`. These builtins are needed to implement [`std::experimental::source_location`](https://rawgit.com/cplusplus/fundamentals-ts/v2/main.html#reflection.src_loc.creation).

With the exception of `__builtin_COLUMN`, GCC also implements these builtins, and Clangs behavior is intended to match as closely as possible.

Reviewers: rsmith, joerg, aaron.ballman, bogner, majnemer, shafik, martong

Reviewed By: rsmith

Subscribers: rnkovacs, loskutov, riccibruno, mgorny, kunitoki, alexr, majnemer, hfinkel, cfe-commits

Differential Revision: https://reviews.llvm.org/D37035

llvm-svn: 360937

show more ...


# 3ff9c51e 11-May-2019 Simon Pilgrim <[email protected]>

ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.

Duplicate getOffset() call.

llvm-svn: 360515


# 899d1392 24-Apr-2019 Fangrui Song <[email protected]>

Use llvm::stable_sort

llvm-svn: 359098


# f170dff3 19-Mar-2019 Don Hinton <[email protected]>

Refactor cast<>'s in if conditionals, which can only assert on failure.

Summary:
This patch refactors several instances of cast<> used in if
conditionals. Since cast<> asserts on failure, the else

Refactor cast<>'s in if conditionals, which can only assert on failure.

Summary:
This patch refactors several instances of cast<> used in if
conditionals. Since cast<> asserts on failure, the else branch can
never be taken.

In some cases, the fix is to replace cast<> with dyn_cast<>. While
others required the removal of the conditional and some minor
refactoring.

A discussion can be seen here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190318/265044.html

Differential Revision: https://reviews.llvm.org/D59529

llvm-svn: 356441

show more ...


Revision tags: llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4
# 1488ee4b 08-Mar-2019 Akira Hatanaka <[email protected]>

[ObjC] Emit a boxed expression as a compile-time constant if the
expression inside the parentheses is a valid UTF-8 string literal.

Previously clang emitted an expression like @("abc") as a message

[ObjC] Emit a boxed expression as a compile-time constant if the
expression inside the parentheses is a valid UTF-8 string literal.

Previously clang emitted an expression like @("abc") as a message send
to stringWithUTF8String. This commit makes clang emit the boxed
expression as a compile-time constant instead.

This commit also has the effect of silencing the nullable-to-nonnull
conversion warning clang started emitting after r317727, which
originally motivated this commit (see https://oleb.net/2018/@keypath).

rdar://problem/42684601

Differential Revision: https://reviews.llvm.org/D58729

llvm-svn: 355662

show more ...


# 8f7caae0 06-Mar-2019 Leonard Chan <[email protected]>

[Fixed Point Arithmetic] Fixed Point and Integer Conversions

This patch includes the necessary code for converting between a fixed point type and integer.
This also includes constant expression eval

[Fixed Point Arithmetic] Fixed Point and Integer Conversions

This patch includes the necessary code for converting between a fixed point type and integer.
This also includes constant expression evaluation for conversions with these types.

Differential Revision: https://reviews.llvm.org/D56900

llvm-svn: 355462

show more ...


Revision tags: llvmorg-8.0.0-rc3
# 7f98e3c2 08-Feb-2019 Eli Friedman <[email protected]>

[CodeGen][NFC] Update comments in CGExprConstant.cpp.

llvm-svn: 353571


# 3bf72d7d 08-Feb-2019 Eli Friedman <[email protected]>

[Sema] Make string literal init an rvalue.

This allows substantially simplifying the expression evaluation code,
because we don't have to special-case lvalues which are actually string
literal initi

[Sema] Make string literal init an rvalue.

This allows substantially simplifying the expression evaluation code,
because we don't have to special-case lvalues which are actually string
literal initialization.

This currently throws away an optimization where we would avoid creating
an array APValue for string literal initialization. If we really want
to optimize this case, we should fix APValue so it can store simple
arrays more efficiently, like llvm::ConstantDataArray. This shouldn't
affect the memory usage for other string literals. (Not sure if this is
a blocker; I don't think string literal init is common enough for this
to be a serious issue, but I could be wrong.)

The change to test/CodeGenObjC/encode-test.m is a weird side-effect of
these changes: we currently don't constant-evaluate arrays in C, so the
strlen call shouldn't be folded, but lvalue string init managed to get
around that check. I this this is fine.

Fixes https://bugs.llvm.org/show_bug.cgi?id=40430 .

llvm-svn: 353569

show more ...


Revision tags: llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1
# 3f82f9e1 22-Jan-2019 Eli Friedman <[email protected]>

[CodeGen] Always use string computed in Sema for PredefinedExpr

We can't use any other string, anyway, because its type wouldn't
match the type of the PredefinedExpr.

With this change, we don't com

[CodeGen] Always use string computed in Sema for PredefinedExpr

We can't use any other string, anyway, because its type wouldn't
match the type of the PredefinedExpr.

With this change, we don't compute a "nice" name for the __func__ global
when it's used in the initializer for a constant. This doesn't seem like
a great loss, and I'm not sure how to fix it without either storing more
information in the AST, or somehow threading through the information
from ExprConstant.cpp.

This could break some situations involving BlockDecl; currently,
CodeGenFunction::EmitPredefinedLValue has some logic to intentionally
emit a string different from what Sema computed. This code skips that
logic... but that logic can't work correctly in general anyway. (For
example, sizeof(__func__) returns the wrong result.) Hopefully this
doesn't affect practical code.

Fixes https://bugs.llvm.org/show_bug.cgi?id=40313 .

Differential Revision: https://reviews.llvm.org/D56821

llvm-svn: 351766

show more ...


# 2946cd70 19-Jan-2019 Chandler Carruth <[email protected]>

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the ne

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636

show more ...


# 86285d2e 16-Jan-2019 Leonard Chan <[email protected]>

[Fixed Point Arithmetic] Add APFixedPoint to APValue

This adds APFixedPoint to the union of values that can be represented with an APValue.

Differential Revision: https://reviews.llvm.org/D56746

l

[Fixed Point Arithmetic] Add APFixedPoint to APValue

This adds APFixedPoint to the union of values that can be represented with an APValue.

Differential Revision: https://reviews.llvm.org/D56746

llvm-svn: 351368

show more ...


Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3
# 958b94d6 01-Dec-2018 Bill Wendling <[email protected]>

Correct indentation.

llvm-svn: 348071


# 2a81f667 01-Dec-2018 Bill Wendling <[email protected]>

Specify constant context in constant emitter

The constant emitter may need to evaluate the expression in a constant context.
For exasmple, global initializer lists.

llvm-svn: 348070


# 90a05631 30-Nov-2018 Bill Wendling <[email protected]>

Revert r348029. I was git-ing and jumped the gun.

llvm-svn: 348032


# e64fe2ab 30-Nov-2018 Bill Wendling <[email protected]>

We're in a constant context in the ConstantEmitter.

llvm-svn: 348029


# 8003edc9 09-Nov-2018 Bill Wendling <[email protected]>

Compound literals, enums, et al require const expr

Summary:
Compound literals, enums, file-scoped arrays, etc. require their
initializers and size specifiers to be constant. Wrap the initializer
ex

Compound literals, enums, et al require const expr

Summary:
Compound literals, enums, file-scoped arrays, etc. require their
initializers and size specifiers to be constant. Wrap the initializer
expressions in a ConstantExpr so that we can easily check for this later
on.

Reviewers: rsmith, shafik

Reviewed By: rsmith

Subscribers: cfe-commits, jyknight, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D53921

llvm-svn: 346455

show more ...


Revision tags: llvmorg-7.0.1-rc2
# e3b7144e 02-Nov-2018 Erik Pilkington <[email protected]>

[CodeGen] Fix a crash when updating a designated initializer

We need to handle the ConstantAggregateZero case here too.

rdar://45691981

Differential revision: https://reviews.llvm.org/D54010

llvm

[CodeGen] Fix a crash when updating a designated initializer

We need to handle the ConstantAggregateZero case here too.

rdar://45691981

Differential revision: https://reviews.llvm.org/D54010

llvm-svn: 346004

show more ...


Revision tags: llvmorg-7.0.1-rc1
# 17ff026b 27-Oct-2018 Bruno Ricci <[email protected]>

[AST] Refactor PredefinedExpr

Make the following changes to PredefinedExpr:

1. Move PredefinedExpr below StringLiteral so that it can use its definition.
2. Rename IdentType to IdentKind to be more

[AST] Refactor PredefinedExpr

Make the following changes to PredefinedExpr:

1. Move PredefinedExpr below StringLiteral so that it can use its definition.
2. Rename IdentType to IdentKind to be more in line with clang's conventions,
and propagate the change to its users.
3. Move the location and the IdentKind into the newly available space of
the bit-fields of Stmt.
4. Only store the function name when needed. When parsing all of Boost,
of the 1357 PredefinedExpr 919 have no function name.

Differential Revision: https://reviews.llvm.org/D53605

Reviewed By: rjmccall

llvm-svn: 345460

show more ...


# b4ba467d 23-Oct-2018 Leonard Chan <[email protected]>

[Fixed Point Arithmetic] Fixed Point to Boolean Cast

This patch is a part of https://reviews.llvm.org/D48456 in an attempt to split
the casting logic up into smaller patches. This contains the code

[Fixed Point Arithmetic] Fixed Point to Boolean Cast

This patch is a part of https://reviews.llvm.org/D48456 in an attempt to split
the casting logic up into smaller patches. This contains the code for casting
from fixed point types to boolean types.

Differential Revision: https://reviews.llvm.org/D53308

llvm-svn: 345063

show more ...


# b555b76e 23-Oct-2018 Andrew Savonichev <[email protected]>

[OpenCL][NFC] Unify ZeroToOCL* cast types

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: asavonic, cfe-commits

Differential Revision: https://reviews.llvm.org/D52654

llvm-svn:

[OpenCL][NFC] Unify ZeroToOCL* cast types

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: asavonic, cfe-commits

Differential Revision: https://reviews.llvm.org/D52654

llvm-svn: 345038

show more ...


# 99bda375 15-Oct-2018 Leonard Chan <[email protected]>

[Fixed Point Arithmetic] FixedPointCast

This patch is a part of https://reviews.llvm.org/D48456 in an attempt to
split them up. This contains the code for casting between fixed point types
and other

[Fixed Point Arithmetic] FixedPointCast

This patch is a part of https://reviews.llvm.org/D48456 in an attempt to
split them up. This contains the code for casting between fixed point types
and other fixed point types.

The method for converting between fixed point types is based off the convert()
method in APFixedPoint.

Differential Revision: https://reviews.llvm.org/D50616

llvm-svn: 344530

show more ...


Revision tags: llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2
# 749e8285 08-Aug-2018 Balaji V. Iyer <[email protected]>

[CodeGen] IncompleteArray Support

Added code to support ArrayType that is not ConstantArray.

https://reviews.llvm.org/D49952
rdar://42476155

llvm-svn: 339207


Revision tags: llvmorg-7.0.0-rc1
# 6907ce2f 30-Jul-2018 Fangrui Song <[email protected]>

Remove trailing space

sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h}

llvm-svn: 338291


12345678910>>...20