summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2019-07-15 23:49:31 +0000
committerEric Christopher <echristo@gmail.com>2019-07-15 23:49:31 +0000
commit1578c321ad8a91bc74397c26b5e22e232935fdef (patch)
tree2b87000e45075ec645ea252cced18228dd6ad49b /lib/CodeGen/CGExpr.cpp
parent115f2b6fe6cc41e7d5982b4d9d1150a7917e7805 (diff)
downloadclang-1578c321ad8a91bc74397c26b5e22e232935fdef.tar.gz
Temporarily Revert "fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic"
The commit had tests that would only work with names in the IR. This reverts commit r366076. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 25d2424eb8..62d930ca8c 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -3892,23 +3892,6 @@ LValue CodeGenFunction::EmitLValueForLambdaField(const FieldDecl *Field) {
return EmitLValueForField(LambdaLV, Field);
}
-/// Get the field index in the debug info. The debug info structure/union
-/// will ignore the unnamed bitfields.
-unsigned CodeGenFunction::getDebugInfoFIndex(const RecordDecl *Rec,
- unsigned FieldIndex) {
- unsigned I = 0, Skipped = 0;
-
- for (auto F : Rec->getDefinition()->fields()) {
- if (I == FieldIndex)
- break;
- if (F->isUnnamedBitfield())
- Skipped++;
- I++;
- }
-
- return FieldIndex - Skipped;
-}
-
/// Get the address of a zero-sized field within a record. The resulting
/// address doesn't necessarily have the right type.
static Address emitAddrOfZeroSizeField(CodeGenFunction &CGF, Address Base,
@@ -3948,7 +3931,7 @@ static Address emitPreserveStructAccess(CodeGenFunction &CGF, Address base,
CGF.CGM.getTypes().getCGRecordLayout(rec).getLLVMFieldNo(field);
return CGF.Builder.CreatePreserveStructAccessIndex(
- base, idx, CGF.getDebugInfoFIndex(rec, field->getFieldIndex()), DbgInfo);
+ base, idx, field->getFieldIndex(), DbgInfo);
}
static bool hasAnyVptr(const QualType Type, const ASTContext &Context) {
@@ -4065,7 +4048,7 @@ LValue CodeGenFunction::EmitLValueForField(LValue base,
getContext().getRecordType(rec), rec->getLocation());
addr = Address(
Builder.CreatePreserveUnionAccessIndex(
- addr.getPointer(), getDebugInfoFIndex(rec, field->getFieldIndex()), DbgInfo),
+ addr.getPointer(), field->getFieldIndex(), DbgInfo),
addr.getAlignment());
}
} else {