@@ -2486,10 +2486,8 @@ llvm::Value *CodeGenFunction::EmitAnnotationCall(llvm::Function *AnnotationFn,
2486
2486
const AnnotateAttr *Attr) {
2487
2487
SmallVector<llvm::Value *, 5 > Args = {
2488
2488
AnnotatedVal,
2489
- Builder.CreateBitCast (CGM.EmitAnnotationString (AnnotationStr),
2490
- ConstGlobalsPtrTy),
2491
- Builder.CreateBitCast (CGM.EmitAnnotationUnit (Location),
2492
- ConstGlobalsPtrTy),
2489
+ CGM.EmitAnnotationString (AnnotationStr),
2490
+ CGM.EmitAnnotationUnit (Location),
2493
2491
CGM.EmitAnnotationLineNo (Location),
2494
2492
};
2495
2493
if (Attr)
@@ -2499,15 +2497,10 @@ llvm::Value *CodeGenFunction::EmitAnnotationCall(llvm::Function *AnnotationFn,
2499
2497
2500
2498
void CodeGenFunction::EmitVarAnnotations (const VarDecl *D, llvm::Value *V) {
2501
2499
assert (D->hasAttr <AnnotateAttr>() && " no annotate attribute" );
2502
- // FIXME We create a new bitcast for every annotation because that's what
2503
- // llvm-gcc was doing.
2504
- unsigned AS = V->getType ()->getPointerAddressSpace ();
2505
- llvm::Type *I8PtrTy = Builder.getPtrTy (AS);
2506
2500
for (const auto *I : D->specific_attrs <AnnotateAttr>())
2507
2501
EmitAnnotationCall (CGM.getIntrinsic (llvm::Intrinsic::var_annotation,
2508
- {I8PtrTy, CGM.ConstGlobalsPtrTy }),
2509
- Builder.CreateBitCast (V, I8PtrTy, V->getName ()),
2510
- I->getAnnotation (), D->getLocation (), I);
2502
+ {V->getType (), CGM.ConstGlobalsPtrTy }),
2503
+ V, I->getAnnotation (), D->getLocation (), I);
2511
2504
}
2512
2505
2513
2506
Address CodeGenFunction::EmitFieldAnnotations (const FieldDecl *D,
0 commit comments