Skip to content

Commit 8a9ace5

Browse files
committed
Another take on annotations
1 parent 058795e commit 8a9ace5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

clang/lib/Interpreter/InterpreterValuePrinter.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,18 @@ llvm::Expected<Expr *> Interpreter::convertExprToValue(Expr *E) {
640640
using namespace clang;
641641

642642
// Temporary rvalue struct that need special care.
643-
extern "C" void *REPL_EXTERNAL_VISIBILITY __clang_Interpreter_SetValueWithAlloc(
644-
void *This, void *OutVal, void *OpaqueType) {
643+
extern "C" {
644+
REPL_EXTERNAL_VISIBILITY void *
645+
__clang_Interpreter_SetValueWithAlloc(void *This, void *OutVal,
646+
void *OpaqueType) {
645647
Value &VRef = *(Value *)OutVal;
646648
VRef = Value(static_cast<Interpreter *>(This), OpaqueType);
647649
return VRef.getPtr();
648650
}
649651

650-
extern "C" void REPL_EXTERNAL_VISIBILITY __clang_Interpreter_SetValueNoAlloc(
651-
void *This, void *OutVal, void *OpaqueType, ...) {
652+
REPL_EXTERNAL_VISIBILITY void
653+
__clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType,
654+
...) {
652655
Value &VRef = *(Value *)OutVal;
653656
Interpreter *I = static_cast<Interpreter *>(This);
654657
VRef = Value(I, OpaqueType);
@@ -723,14 +726,15 @@ extern "C" void REPL_EXTERNAL_VISIBILITY __clang_Interpreter_SetValueNoAlloc(
723726
}
724727
va_end(args);
725728
}
729+
}
726730

727731
// A trampoline to work around the fact that operator placement new cannot
728732
// really be forward declared due to libc++ and libstdc++ declaration mismatch.
729733
// FIXME: __clang_Interpreter_NewTag is ODR violation because we get the same
730734
// definition in the interpreter runtime. We should move it in a runtime header
731735
// which gets included by the interpreter and here.
732736
struct __clang_Interpreter_NewTag {};
733-
void *REPL_EXTERNAL_VISIBILITY
737+
REPL_EXTERNAL_VISIBILITY void *
734738
operator new(size_t __sz, void *__p, __clang_Interpreter_NewTag) noexcept {
735739
// Just forward to the standard operator placement new.
736740
return operator new(__sz, __p);

0 commit comments

Comments
 (0)